Skip to content

croissant-baker

🥐 Generate Croissant metadata for datasets with automatic type inference

Usage:

$ croissant-baker [OPTIONS] COMMAND [ARGS]...

Options:

  • -i, --input <str>: Directory containing dataset files
  • -o, --output <str>: Output file path
  • --validate / --no-validate: Validate metadata before saving [default: validate]
  • --version: Show version and exit
  • --name <str>: Dataset name (defaults to directory name)
  • --description <str>: Dataset description
  • --url <str>: Dataset URL (e.g., https://example.com/dataset)
  • --license <str>: License URL or SPDX identifier (e.g., CC-BY-4.0)
  • --citation <str>: Citation text (preferably BibTeX format)
  • --dataset-version <str>: Dataset version (e.g., 1.0.0)
  • --date-published <str>: Publication date (e.g., 2023-12-15 or 2023-12-15T10:30:00)
  • --date-created <str>: Creation date (e.g., 2023-12-15 or 2023-12-15T10:30:00).
  • --date-modified <str>: Last-modified date (e.g., 2023-12-15 or 2023-12-15T10:30:00).
  • --creator <list[str]>: Creator information. Format: 'Name[,Email[,URL]]'. Use multiple times for multiple creators. Examples: --creator 'John Doe' --creator 'Jane Smith,jane@example.com,https://jane.com'
  • --publisher <str>: Publishing organization name (e.g., 'PhysioNet').
  • --keywords <list[str]>: Topical keywords for dataset discovery. Repeat (--keywords a --keywords b) or comma-delimit (--keywords 'a,b').
  • --in-language <list[str]>: BCP 47 language code (e.g., 'en'). Repeat or comma-delimit for multilingual datasets.
  • --same-as <list[str]>: URL of an equivalent record (e.g. DOI, mirror landing page). Repeat or comma-delimit.
  • --sd-license <str>: License of the metadata description itself (e.g., 'CC0-1.0'), distinct from the data license.
  • --sd-version <str>: Version of the metadata description (e.g., '1.0.0'), distinct from --dataset-version.
  • --alternate-name <str>: Short alias for the dataset (e.g., 'MIMIC-IV').
  • --is-live-dataset: Mark the dataset as a live, evolving stream (e.g., a continuously-appended log).
  • --temporal-coverage <str>: Time period the data covers. ISO 8601 recommended: '2008/2019' (interval) or '2023-01-15' (point).
  • --usage-info <str>: URI pointing to a usage or consent policy. Any RFC 3986 scheme (http(s), urn, did, mailto). Example: 'http://purl.obolibrary.org/obo/DUO_0000042' (DUO term).
  • --identifier <list[str]>: Accession or persistent identifier the dataset is known by (e.g., 'phs000218.v1.p1', 'EGAS00001000255', a DOI). Repeat or comma-delimit.
  • --conditions-of-access <str>: How access is obtained, in free text. Example: 'Controlled access: Data Access Agreement via the Data Access Committee'.
  • --is-accessible-for-free / --not-accessible-for-free: Whether the data can be had without payment or an access agreement. Omit to leave the field out.
  • --included-in-data-catalog <str>: URL of a catalog entry listing this dataset. Any RFC 3986 scheme (http(s), urn, did, mailto). Example: 'https://datacatalog.ccdi.cancer.gov/'.
  • --profile <list[str]>: Additional profile to declare in conformsTo. One of: bioschemas. The bake is refused if the document lacks the profile's minimum fields. Repeat or comma-delimit.
  • --field-mappings <file>: YAML file mapping columns to external vocabularies (Wikidata, SNOMED, LOINC). Schema: 'fields:\n :\n equivalent_property: \n data_types: [, ...]'. Note: column names match across ALL RecordSets, so 'id' applies to every 'id' column in the dataset.
  • --field-mapping <list[str]>: Link one column to an external vocabulary URI. Format: 'COLUMN=URI'. Example: --field-mapping 'age=http://www.wikidata.org/entity/Q11464'. Matches by bare column name across all RecordSets; a warning prints if a name resolves to multiple fields. Repeatable; combine with --field-mappings (flags override YAML).
  • --count-csv-rows: Count exact row numbers for CSV files (slow for large datasets)
  • --genomic-sample-ids: Emit the sample identifiers a genomic file names in its header (VCF and BCF sample columns; BAM, CRAM and SAM read-group SM tags). Off by default: for a controlled release those identifiers are a manifest of the cohort, and the counts are emitted either way.
  • -j, --jobs <int>: Worker threads for file extraction. 0 = auto (from CPU count), 1 = serial. Output is identical regardless of this value. [default: 0]
  • --detect-references: Detect foreign keys between tables that share a key column (e.g. subject_id) and emit cr:references links. Conservative: links only when a parent table is identifiable by name; shared keys it will not link are reported, and named under --verbose.
  • --rai-data-collection <str>: How and where the data was gathered.
  • --rai-data-collection-type <list[str]>: Collection type, e.g. 'observational'. Can be used multiple times.
  • --rai-data-collection-missing-data <str>: How missing data was handled during collection.
  • --rai-data-collection-raw-data <str>: Description of the raw data before processing.
  • --rai-data-collection-timeframe <list[str]>: Collection date or datetime in ISO format. Can be used multiple times.
  • --rai-data-imputation-protocol <str>: How missing values were imputed.
  • --rai-data-preprocessing-protocol <list[str]>: Preprocessing step. Can be used multiple times.
  • --rai-data-manipulation-protocol <str>: Transformations applied to the data.
  • --rai-data-annotation-protocol <list[str]>: Annotation procedure. Can be used multiple times.
  • --rai-data-annotation-platform <list[str]>: Annotation platform or tool. Can be used multiple times.
  • --rai-data-annotation-analysis <list[str]>: Annotation quality or agreement analysis. Can be used multiple times.
  • --rai-annotations-per-item <str>: Annotation density, e.g. '3 annotators per item'.
  • --rai-annotator-demographics <list[str]>: Annotator demographic note. Can be used multiple times.
  • --rai-machine-annotation-tools <list[str]>: Automated annotation tool. Can be used multiple times.
  • --rai-data-biases <list[str]>: Known bias description. Can be used multiple times.
  • --rai-data-use-cases <list[str]>: Intended use case. Can be used multiple times.
  • --rai-data-limitations <list[str]>: Known limitation. Can be used multiple times.
  • --rai-data-social-impact <str>: Potential social impact of using the dataset.
  • --rai-personal-sensitive-information <list[str]>: Sensitive information note. Can be used multiple times.
  • --rai-data-release-maintenance-plan <str>: How the dataset release will be maintained over time.
  • --rai-config <file>: Path to a RAI config YAML file (see rai-example.yaml for the template)
  • -I, --include <list[str]>: Glob pattern to include (e.g., '*.csv'). Can be used multiple times.
  • -E, --exclude <list[str]>: Glob pattern to exclude (e.g., '*.tmp'). Can be used multiple times.
  • --dry-run: Perform a dry run to list matching files without generating metadata.
  • --report <path>: Write a JSON scan report naming every file found and its outcome.
  • -v, --verbose: Also list each undescribed file and its reason, not the summary alone.
  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • rai-apply: Apply RAI attributes from a config YAML to...
  • mcp: Serve the dry_run, bake and validate tools...
  • validate: Validate a Croissant metadata file.

croissant-baker rai-apply

Apply RAI attributes from a config YAML to an existing Croissant file.

Usage:

$ croissant-baker rai-apply [OPTIONS] {file_path}

Arguments:

  • file_path <str>: Croissant metadata file to update [required]

Options:

  • --rai-config <file>: RAI config YAML file [required]
  • -o, --output <str>: Output path (defaults to overwriting the input file)
  • --validate / --no-validate: Validate after applying RAI attributes [default: validate]
  • --help: Show this message and exit.

croissant-baker mcp

Serve the dry_run, bake and validate tools over stdio to a local agent.

Model Context Protocol, stdio transport only: no HTTP listener and no outbound requests, so a bake still never leaves the local environment.

Usage:

$ croissant-baker mcp [OPTIONS]

Options:

  • --help: Show this message and exit.

croissant-baker validate

Validate a Croissant metadata file.

Usage:

$ croissant-baker validate [OPTIONS] {file_path}

Arguments:

  • file_path <str>: Path to Croissant metadata file [required]

Options:

  • --help: Show this message and exit.