bsie.reader package#

The Reader classes return high-level content structures from files.

The Reader fulfills two purposes: First, it brokers between multiple libraries and file formats. Second, it separates multiple aspects of a file into distinct content types.

Often, different libraries focus on reading different types of content from a file. E.g. one would use different modules to read file system infos than to read exif or pixel data of an image. Hence, this module is organized by content type. Each distinct type can be implemented in a file or submodule that provides a Reader implementation. Through utilization of submodules, different file formats can be supported.

class bsie.reader.Reader#

Bases: ABC

Read and return some content from a file.

class bsie.reader.ReaderBuilder(kwargs: Dict[str, Dict[str, Any]] | None = None)#

Bases: object

Build bsie.base.Reader instances.

Readers are defined via their qualified class name (e.g., bsie.reader.path.Path) and optional keyword arguments that are passed to the constructor via the kwargs argument (name as key, kwargs as value). The ReaderBuilder keeps a cache of previously built reader instances, as they are anyway built with identical keyword arguments.

build(name: str) Reader#

Return an instance for the qualified class name.