bootstack.data.register_reader#

bootstack.data.register_reader(*extensions, reader=None)#

Register a reader for one or more file extensions.

Use as a decorator (@register_reader(".csv", ".tsv")) or call directly with reader=. Extensions may be given with or without the leading dot.

Parameters:
  • extensions (str) – File extensions the reader handles.

  • reader (Callable[[...], Iterator[Dict[str, Any]]] | None) – The reader callable, when not used as a decorator.

Returns:

The reader (so it works as a decorator).