Skip to main content

A tool to automatically generate Croissant metadata for datasets.

Project description

croissant-baker

Croissant Baker

CI Python 3.10+ uv License: MIT PyPI arXiv PRs Welcome

Automatically generate Croissant JSON-LD metadata for ML datasets — e.g. for PhysioNet, NeurIPS Datasets & Benchmarks submissions, or any platform that benefits from standardized dataset metadata.

📖 Documentation


Installation

pip install croissant-baker

or with uv:

uv add croissant-baker

Quick start

croissant-baker \
  --input /path/to/dataset \
  --creator "Your Name,you@example.com" \
  --description "My ML dataset" \
  --license "CC-BY-4.0" \
  --output my-dataset-croissant.jsonld

Or try with the bundled MIMIC-IV Demo test data:

git clone https://github.com/MIT-LCP/croissant-baker.git && cd croissant-baker
uv sync --group dev
croissant-baker \
  --input tests/data/input/mimiciv_demo/physionet.org/files/mimic-iv-demo/ \
  --creator "Alistair Johnson,aewj@mit.edu,https://physionet.org/" \
  --creator "Tom Pollard,tpollard@mit.edu,https://physionet.org/" \
  --name "MIMIC-IV Clinical Database Demo" \
  --description "Demo subset of MIMIC-IV containing 100 de-identified patients from Beth Israel Deaconess Medical Center" \
  --url "https://physionet.org/content/mimic-iv-demo/2.2/" \
  --license "https://opendatacommons.org/licenses/odbl/1-0/" \
  --rai-data-biases "Single-site cohort from a US academic medical centre" \
  --rai-data-limitations "Demo subset limited to 100 patients" \
  --output mimic-iv-demo-croissant.jsonld
croissant-baker validate mimic-iv-demo-croissant.jsonld

Supported formats

Format Extensions Notes
CSV / TSV .csv, .tsv + .gz, .bz2, .xz Streaming with automatic type inference
Parquet .parquet Partitioned datasets supported
FHIR .ndjson, .ndjson.gz, .json (Bundle) NDJSON bulk export and JSON Bundle
JSON / JSONL .json, .jsonl + .gz Arrays, single objects, and JSON Lines
WFDB .hea + .dat / .atr PhysioNet waveform data
Images .png, .jpg, .tiff, .bmp, .gif, .webp Dimensions and format via Pillow
DICOM .dcm, .dicom Modality, geometry, study/series UIDs via pydicom (header only)
NIfTI .nii, .nii.gz Spatial dims, voxel spacing, TR for fMRI via nibabel (header only)

Key features

  • Automatic type inference for all supported formats
  • RAI metadata via --rai-* CLI flags or --rai-config rai.yaml
  • Validation against the Croissant spec via mlcroissant
  • Dry-run mode, include/exclude glob filters, multiple creators

See the documentation for full CLI reference, examples, and RAI configuration.

Contributing

See CONTRIBUTING.md for guidelines and DEVELOPMENT.md for setup, testing, releases, and how to add new file handlers.

Citation

If you use Croissant Baker in your research, please cite our arXiv preprint:

@misc{attrach2026croissantbakermetadatageneration,
      title={Croissant Baker: Metadata Generation for Discoverable, Governable, and Reusable ML Datasets},
      author={Rafi Al Attrach and Rajna Fani and Sebastian Lobentanzer and Joan Giner-Miguelez and Debanshu Das and Varuni H. K. and Nobin Sarwar and Rajat Ghosh and Anwai Archit and Surbhi Motghare and Christina Conrad Parry and Luis Oala and Lara Grosso and Joaquin Vanschoren and Steffen Vogler and Sujata Goswami and Eric S. Rosenthal and Marzyeh Ghassemi and Matthew McDermott and Tom Pollard},
      year={2026},
      eprint={2605.15079},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2605.15079},
}

License

MIT License - see LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

croissant_baker-0.3.1-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

Details for the file croissant_baker-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: croissant_baker-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 66.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for croissant_baker-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8807377a5552887cb7ccb44d9d42cb18e474c88b2ac232635f8f0809419f10eb
MD5 08123d43991b46d57cf4b5cb65fe583b
BLAKE2b-256 7d08b683831a81861a961219e1e7f97159f5fab3ed4fa66bf41091edff22b0b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page