yadg.extractors package

yadg.extractors.extract(filetype: str, path: Path | str, timezone: str | None = None, encoding: str | None = None, locale: str | None = None, suffix: str | None = None, **kwargs: dict) DataTree

Extract data and metadata from a path using the supplied filetype.

A wrapper around the extract_from_path() and extract_from_zip() worker functions. Creates a default extractor object for a given filetype. Coerces any str`s provided as ``path` to Path. If the provided path is a zip file, it is treated as such.

Parameters:
  • filetype – Specifies the filetype. Has to be a filetype supported by the dataschema.

  • path – A Path object pointing to the file to be extracted.

  • timezone – A str containing the TZ identifier, e.g. “Europe/Berlin”.

  • encoding – A str containing the encoding, e.g. “utf-8”.

  • locale – A str containing the locale name, e.g. “de_CH”.

  • suffix – A str containing a non-default suffix for matching files within a zip file.

Subpackages