extract_metadata
extract_metadata(parquet_path: Path, /, *, output_path: Path | None = None)Extract metadata from a Parquet file.
Data types are extracted from the Parquet’s loaded DataFrame’s schema and mapped from Polars to the Data Package Standard data types. For best results, ensure that the DataFrame’s schema is correct—this may require some manually fixing. Since there are differences between Polars and Data Package data types, the mapping may not always be perfect, and some data types may be extracted to simpler types. For example, a year column may be extracted as an integer instead of Data Package’s year type. Be sure to review and modify the extracted properties to suit your needs.
Parameters
parquet_path : Path-
The path to the Parquet file.
output_path : Path | None = None-
The path where the extracted metadata should be saved. Defaults to
<parquet-filename>_properties.pyin the current working directory.