aeat.adapters.inbound.financial.providers._detection module¶
Provider registry and file-format auto-detection.
Exposes detect_provider, the entry point the financial-ingest application
layer calls to pick a concrete
FinancialProvider for an
arbitrary path. The detection strategy combines extension hinting with
magic-byte sniffing so a misnamed file (a PDF saved as .csv, an XLSX inside
a .txt, etc.) still routes to the right parser.
- provider_for_extension(path)[source]¶
Return a
FinancialProviderkeyed strictly offpath’s suffix.Cheap fallback used by CLI command surfaces when content-aware detection (
detect_provider()) returnsNonebut the path’s suffix is unambiguous. Unlikedetect_provider()this does not open the file or sniff its bytes.Returns
Nonefor every extension the project does not recognise (PDF among them —PdfN26Providerrequires content-aware detection because the bare.pdfsuffix carries no statement flavour information).- Return type:
- Parameters:
path (Path)
- detect_provider(path)[source]¶
Return the first provider that validates the source successfully.
Walks an extension- and content-prioritised candidate list and returns the first provider whose
validate_sourceresult is anis_validProviderValidation.- Parameters:
path (
Path) – Source document to classify.- Return type:
- Returns:
The matching
FinancialProvider, orNonewhen no provider can interpretpath.