Parquet export and dataset distribution #18
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The end goal of pcdigitizer is ML-ready datasets. Right now, the only way to get data is by calling the API at runtime. For reproducibility, sharing, and downstream tooling, we need to export complete, pre-processed datasets as Parquet files.
Scope
Create
pcdigitizer/export.pywith anexport_annotationfunction that fetches all pages for a given annotation, processes them, concatenates the resulting DataFrames, and writes a single Parquet file usingpolars.DataFrame.write_parquet()with zstd or snappy compression.Add a CLI entry point:
python -m pcdigitizer export --annotation "Dissociation Constants" --output pka_dataset.parquet. Useargparse, no extra dependencies.Embed metadata in the Parquet schema:
pcdigitizer_version,annotation,export_date(ISO timestamp), andtotal_pages. Add aread_datasetconvenience function that reads the Parquet back and validates the schema.Definition of done
A CLI command that exports a complete annotation to Parquet. Metadata embedded in the file. Round-trip test: export, read, verify schema, and row count.