cadrumo.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.

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_source result is an is_valid ProviderValidation.

Parameters:

path (Path) – Source document to classify.

Return type:

FinancialProvider | None

Returns:

The matching FinancialProvider, or None when no provider can interpret path.