Adapters¶
Adapters normalize various data sources into iterables of records.
ListDictAdapter¶
ListDictAdapter ¶
Bases: InputAdapter[Iterable[Mapping[str, Any]]]
Adapter for data already in memory as an iterable of dicts.
JsonAdapter¶
JsonAdapter ¶
Bases: InputAdapter[str | bytes | Mapping[str, Any] | list[Any]]
Adapter for JSON data already present in memory. Supports JSON strings, bytes, or pre-parsed dicts/lists.
JsonStreamingAdapter¶
JsonStreamingAdapter(item_path: str = 'item') dataclass ¶
Bases: InputAdapter[str | Path | BinaryIO]
Adapter for high-performance JSON streaming from files or binary streams. Uses ijson to parse the input iteratively, keeping memory usage constant.
SqlAdapter¶
SqlAdapter(query: str, connection: DBConnection, params: tuple[Any, ...] | dict[str, Any] | None = None) dataclass ¶
InputAdapter (Protocol)¶
InputAdapter ¶
Bases: Protocol
Normalize a data source to an iterable of mapping records.
Custom Adapter¶
See Data Sources — Custom Adapter for a complete example.