Skip to main content

fair-metadata-integration

Integrate and package all metadata into RO-Crate, linking to other metadata files.

Given a Bilayers workflow specification and the image data an analysis consumed and produced, this package writes a Workflow RO-Crate: an ro-crate-metadata.json describing the run, alongside copies of the files it describes.

Installation

pip install fair-metadata-integration

Requires Python 3.12 or newer. rocrate is installed automatically.

Usage

from fair_metadata_integration import create_ro_crate

create_ro_crate(
    dest_path="crate",
    workflow_schema_filename="config.yaml",
    input_path="input.ome.zarr",
    output_paths=["output.ome.zarr"],
)
  • dest_path — directory the crate is written to, created if it does not exist.
  • workflow_schema_filename — the Bilayers config.yaml describing the workflow.
  • input_path — the input image (an OME-Zarr directory or a TIFF file).
  • output_paths — the images the workflow produced. Each gets its own parameter.
  • gen_preview — write an ro-crate-preview.html alongside the metadata (default True).

The source files are copied into the crate, so dest_path ends up self-contained:

crate/
├── config.yaml
├── input.ome.zarr/
├── output.ome.zarr/
├── ro-crate-metadata.json
└── ro-crate-preview.html

ro-crate-preview.html is the human-readable RO-Crate Website for the crate, a static HTML page listing the crate and its data entities, generated by rocrate. It is described in the metadata as a CreativeWork about the root dataset, and is not part of the root dataset's hasPart.

What the crate contains

The workflow specification is the crate's mainEntity, typed as a ComputationalWorkflow. The metadata descriptor declares RO-Crate 1.3, and the root dataset declares the Workflow RO-Crate 1.1 profile:

{
  "@id": "ro-crate-metadata.json",
  "@type": "CreativeWork",
  "about": { "@id": "./" },
  "conformsTo": { "@id": "https://w3id.org/ro/crate/1.3" }
},
{
  "@id": "./",
  "@type": "Dataset",
  "conformsTo": [
    { "@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.1" }
  ],
  "mainEntity": { "@id": "config.yaml" }
}

The workflow's programmingLanguage is a ComputerLanguage entity for the Bilayers specification, identified by its Zenodo concept DOI 10.5281/zenodo.17652333, which resolves to the latest release of the spec.

Inputs and outputs are modelled as FormalParameter entities carrying an EDAM format IRI, from the file name: format_3915 for Zarr, format_3727 for OME-TIFF, format_3591 for TIFF, and PNG, JPEG, HDF5, CSV, TSV, xlsx, JSON, YAML, XML and text. Folders (e.g. OME-Zarr) are Dataset entities, files File entities, copied with their content. Each data entity points back at the parameter it realises via exampleOfWork:

{
  "@id": "input.ome.zarr/",
  "@type": "Dataset",
  "additionalType": "http://edamontology.org/format_3915",
  "exampleOfWork": { "@id": "#input" }
}

The crate's JSON-LD context is extended with terms for describing biological imaging metadata — biosample, specimen, organism_classification, preparation_method, channel and others — so those properties can be added to the crate's entities.

Development

git clone https://github.com/NL-BioImaging/fair-metadata-integration.git
cd fair-metadata-integration
pip install -e ".[test]"
pytest

License

MIT

Metadata

Release files for fair-metadata-integration 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fair-metadata-integration 0.2.3
File Size Uploaded Provenance
fair_metadata_integration-0.2.3.tar.gz 11.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fair-metadata-integration 0.2.3
File Interpreter ABI Platform
fair_metadata_integration-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / fair_metadata_integration-0.2.3.tar.gz

Download URL fair_metadata_integration-0.2.3.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e872badd9cf79fbe9197f57ec1d03e0ee8a0ecf6a339eeb228ca6b2a76923be7
BLAKE2b-256 checksum
How to use checksums
3de5cfc8ea7c38367c102c2d1cbb225cae4cde4af1f79be6330e53db8b902c60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / fair_metadata_integration-0.2.3-py3-none-any.whl

Download URL fair_metadata_integration-0.2.3-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4881953826cd9b15d34ef229f952fbb3cbfb78b664a65d460264164b9a8c482
BLAKE2b-256 checksum
How to use checksums
47606ac78c2b20bc535c9a756026a14de1810596e0e763746b91263239aa7941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for fair-metadata-integration 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fair_metadata_integration-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page