Metadata-Version: 2.4
Name: rembi-mifa
Version: 0.1.2
Summary: Models for REMBI and MIFA metadata specifications for FAIR bioimaging data.
Keywords: rembi,mifa,fair,bioimage,metadata,microscopy
Author: Chris Barnes
Author-email: Chris Barnes <chris.barnes@gerbi-gmb.de>
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Pydantic
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: backports-strenum>=1.3.1 ; python_full_version < '3.11'
Requires-Dist: email-validator>=2.3.0
Requires-Dist: pydantic>=2.12.4
Requires-Python: >=3.10
Project-URL: Repository, https://github.com/clbarnes/rembi-mifa-py
Description-Content-Type: text/markdown

# rembi-mifa

Pydantic-based python models for [REMBI](https://www.ebi.ac.uk/bioimage-archive/rembi-model-reference/) and [MIFA](https://www.ebi.ac.uk/bioimage-archive/mifa-model-reference) metadata for [FAIR](https://en.wikipedia.org/wiki/FAIR_data) bioimaging data.

## Usage

See [`examples/`](./examples/) directory.

## Notes

The original specs lack some documentation and have a few other quirks.
The implementation here may differ from the intended structure in these cases.

- The REMBI specification refers to but does not define the [`AnnotationType`](https://www.ebi.ac.uk/bioimage-archive/rembi-model-reference/#annotationtype) type;
  here we use the MIFA [`AnnotationType`](https://www.ebi.ac.uk/bioimage-archive/mifa-model-reference/#annotationtype) enum.
- the REMBI specification refers to the [`License`](https://www.ebi.ac.uk/bioimage-archive/rembi-model-reference/#license) type but it is empty;
  there is no MIFA type of the same name (although `LicenseType` is close). We just accept a string, and recommend using an [SPDX identifier](https://spdx.org/licenses/).

This implementation is opinionated on certain serialisation/deserialisation features:

- Optional list fields are omitted if empty; optional list fields which are omitted are deserialised to empty lists.
- Date and datetime values are deserialised from RFC 3339 strings or stringified seconds (or milliseconds, depending on the value) since the unix epoch, and serialised to RFC 3339 strings (see the [pydantic docs](https://docs.pydantic.dev/latest/api/standard_library_types/#date-and-time-types) for more details)
- [ORCiD IDs](https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier) may be parsed as only the identifier, but are normalised to URLs; the checksum is also validated
- in a few cases, the specification requires a list but does not state that the list must be non-empty, so this is not validated
- the `keywords` field of `rembi.Study` is probably supposed to represent a delimited list, but it's not specified, so it's left as a plain string here

## Contributing

Use the justfile for most common development tasks.

Releases should be published from CI.
`just bump minor` will

- run various tests
- check that your working tree is clean
- check you are on the `main` branch
- bump the **minor** project version
- commit that change
- tag that commit
- push the changes and tag

Then CI will deploy to PyPI.
