dzdomop: the OMOP CDM as Python classes
The OMOP Common Data Model (CDM) 5.3, 5.4 and 5.5 as ready-made SQLAlchemy and SQLModel classes, plus a loader for the standardized vocabularies you export from Athena.
- Create a complete OMOP schema with one call
- Write and query OMOP data with typed Python classes; the OMOP docs show up in your editor
- Load an Athena export (folder, zip file or download link) into PostgreSQL or SQLite
Status: beta, your feedback is welcome.
Install
pip install dzdomop
| Extra | Installs | Needed for |
|---|---|---|
sqlmodel |
sqlmodel | the OMOP_5_x_sqlmodels modules |
postgres |
psycopg 3 | PostgreSQL (psycopg2 and pg8000 work too) |
pg8000 |
pg8000 | PostgreSQL with postgresql+pg8000:// |
progress |
tqdm | progress bars of the vocabulary loader |
Quickstart
from sqlalchemy import create_engine, select
from sqlalchemy.orm import Session
from omopmodel import OMOP_5_4_declarative as omop
engine = create_engine("sqlite:///omop.db")
omop.metadata.create_all(engine) # every OMOP CDM 5.4 table
with Session(engine) as session:
care_site = omop.CareSite(care_site_id=1, care_site_name="St. Local")
person = omop.Person(
person_id=1,
year_of_birth=1985,
care_site=care_site,
gender_concept_id=0,
race_concept_id=0,
ethnicity_concept_id=0,
)
session.add(person)
session.commit()
print(session.scalars(select(omop.Person)).one().care_site.care_site_name)
Load a vocabulary export from Athena (the zip file, the unzipped folder or the download link):
dzdomop load-vocab athena-export.zip --url sqlite:///omop.db --cdm-version 5.4 --create-tables
Documentation
- User guide: flavors, relationships, validation, vocabularies, PostgreSQL, FAQ
- Upgrading from 0.4
- Changelog
- Source code and issues
Maintainer: Tim Bleimehl · License: MIT
Metadata
Release files for dzdomop 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dzdomop-0.5.0.tar.gz | 825.8 kB | With provenance | Details for dzdomop-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dzdomop-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for dzdomop-0.5.0-py3-none-any.whl |
Total release size: 1.7 MB
Release files / dzdomop-0.5.0.tar.gz
| Download URL | dzdomop-0.5.0.tar.gz |
|---|---|
| Size | 825.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f809196f61fd08bc53df43113975f13866418930e6ae25820414e0833d61d1fa
|
|
BLAKE2b-256 checksum How to use checksums |
b3a03a83ea7c78876de408bf20fef5a8ed6e96babda9bcf13c7bf7bb304432f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logRelease files / dzdomop-0.5.0-py3-none-any.whl
| Download URL | dzdomop-0.5.0-py3-none-any.whl |
|---|---|
| Size | 841.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ee08664b05768c7dc0c8e45099c0a41153b213636180b31e2768cd896018354
|
|
BLAKE2b-256 checksum How to use checksums |
bb10229c1340f66c14c618fa30387507b6a1c239a271c7bd40fd51d0914fb1ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logSecurity for dzdomop 0.5.0
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
Both files in this release have been uploaded with provenance metadata.
Attestation for dzdomop-0.5.0.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 Nov 11, 2026.
Transparency logA 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.