MolDef-spec-python is a Python implementation of the HL7 FHIR MolecularDefinition resource, with structured profiles for Allele and Sequence. These profiles apply structural and semantic constraints to the base FHIR MolecularDefinition resource.
This repository contains the core schema for our broader genomics tooling ecosystem, along with example Jupyter notebooks that demonstrate how to create MolecularDefinition, Allele, and Sequence models in Python using pydantic.
Follow these steps to set up the project for local development.
Make sure you’re logged into GitHub, then clone the repository and navigate into it:
# Clone the repository
git clone https://github.com/yourusername/MolDef-spec-python.git
cd MolDef-spec-pythonWe recommend using Python’s built-in venv module.
python -m venv venvActivate the virtual environment
- macOS/Linux
source venv/bin/activate - Windows
venv\Scripts\activate
-
Installation (until the package is published)
pip install . -
Local Development
pip install -e .[dev]
Confirm the package was installed successfully
pip show fhir.moldef.spec This repository includes example Jupyter notebooks for exploring and experimenting with the project.
We are in the process of packaging this repository so it can be installed as a standlone python package. Once published, it will serve as a dependency for MolDef-VRS-Translator, a tool that transaltes between VRS 2.0 Allele and FHIR Allele Profile.
Currently, both the active schema definitions and the translation logic live in the FHIR-MolDef-python project.
We plan to release two packages:
- Schema (FHIR MolecularDefinition, Allele, and Sequence models)
- Translator (VRS <-> FHIR model conversions).
This modular approach lets you install only what you need.
This project builds on the following packages and resources.