bdf.detect#

bdf.detect(path: str | Path) tuple[str, Plugin][source]#

Resolve (plugin_id, Plugin) for path (local file or URL).

Calls detect_from_ext_or_magic_bytes()detect_from_metadata()detect_from_columns() in sequence, returning early after any stage that narrows candidates to exactly one.

Parameters:

path – Local file path or URL to detect plugin for.

Returns:

Tuple of (plugin_id, Plugin) for the detected file format.

Raises:

ValueError – If detection fails at any stage.