OMOP Alchemy
OMOP Alchemy provides a canonical, typed, SQLAlchemy-first representation of the OHDSI OMOP Common Data Model (CDM).
It is designed to support fluency for research-ready analytics, validation, and exploration of OMOP data using modern Python tooling, without imposing ETL conventions or execution-time side effects.
Design goals
OMOP Alchemy is intentionally:
-
Declarative
Defines tables, columns, relationships, and constraints -
Typed and inspectable
Models are fully typed and introspectable for validation, tooling, and IDE support. -
Backend-agnostic
Layered abstractions for adding in new supported backend behaviours.
Core features
- SQLAlchemy ORM models for OMOP CDM tables
- Explicit foreign key and relationship definitions
- Lightweight mapper versions to provide simple model validation against CDM for use in ETL loops without side-effects or performance hit that can come from relationship instantiation within the runtime
- Read-only View classes for safe navigation and analytics that include complex multi-table objects such as conditions with their modifiers, episodes with their events
- Domain validation helpers for OMOP concept integrity
Example (concept navigation)
from omop_alchemy.cdm.model.vocabulary.concept import ConceptView
concept = session.get(ConceptView, 320128) # Lung cancer
concept.domain.domain_id # "Condition"
concept.vocabulary.vocabulary_id # "SNOMED"
concept.is_standard # True
Status
The core API under cdm/ should be considered stable as of the 1.x release.
The toolkit API is experimental and carries no compatibility guarantees. Feedback and issues are welcome.
Some additional background
This work builds on earlier research and tooling presented at the 2023 OHDSI APAC Symposium
see background paper.
Configuration
OMOP Alchemy reads all database connection and schema settings from oa-configurator. No .env files or ENGINE environment variables are needed.
Run once after installation:
omop-config init
omop-config configure omop_alchemy
See Configuration for full details.
Metadata
Release files for omop-alchemy 2.0.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 | |
|---|---|---|---|
| omop_alchemy-2.0.0.tar.gz | 734.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| omop_alchemy-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.0 MB
Release files / omop_alchemy-2.0.0.tar.gz
| Download URL | omop_alchemy-2.0.0.tar.gz |
|---|---|
| Size | 734.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
403848b2c377ef6200119f4d5280a1b7e1abe0c42e8681fe16a74ee87fa82259
|
|
BLAKE2b-256 checksum How to use checksums |
104ba925c1db558070a4a807a38456a90dab33ab766e18cd3de890dae94295ca
|
| 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 10, 2026.
Transparency logRelease files / omop_alchemy-2.0.0-py3-none-any.whl
| Download URL | omop_alchemy-2.0.0-py3-none-any.whl |
|---|---|
| Size | 298.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17cdbf3d901f23da339b7e4d4598f22f178499733fa326884de6e0de40c78f02
|
|
BLAKE2b-256 checksum How to use checksums |
7ad22c271ce7d09b978bf812b698baf9000f1bc56afa2d1915b58c9b079875db
|
| 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 10, 2026.
Transparency log