SQLAlchemy-based models, validation, and utilities for the OHDSI OMOP Common Data Model
Project description
OMOP Alchemy
OMOP Alchemy provides a canonical, typed, SQLAlchemy-first representation of the OHDSI OMOP Common Data Model (CDM).
It is designed to support 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 -
SQLAlchemy-native
Built for SQLAlchemy 2.x ORM usage -
Safe to import anywhere
No implicit engine creation, no global state, no environment assumptions. -
Typed and inspectable
Models are fully typed and introspectable for validation, tooling, and IDE support. -
Backend-agnostic
Designed to work across PostgreSQL, SQLite, and other SQLAlchemy-supported databases.
What this package does not do
OMOP Alchemy deliberately avoids:
- Enforcing ETL conventions or data pipelines
- Auto-creating databases or loading vocabularies
- Imposing analytics frameworks or dashboards
- Making assumptions about deployment environments
These concerns are intentionally left to downstream tooling.
Core features
- SQLAlchemy ORM models for OMOP CDM tables
- Explicit foreign key and relationship definitions
- Read-only View classes for safe navigation and analytics
- Domain validation helpers for OMOP concept integrity
- CSV loading utilities for controlled ingestion and testing
- Lightweight schema and model validation against CDM specs
Example (concept navigation)
from omop_alchemy.model.vocabulary import ConceptView
concept = session.get(ConceptView, 320128) # Lung cancer
concept.domain.domain_id # "Condition"
concept.vocabulary.vocabulary_id # "SNOMED"
concept.is_standard # True
Status
This project is currently beta.
The API is stabilising, but some modules may change as real-world use cases expand. 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omop_alchemy-0.5.4.tar.gz.
File metadata
- Download URL: omop_alchemy-0.5.4.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbd70a434d01fb2f0d7de680322a1dbf415e8ccfb5ee72a3dd48ed03b09cac17
|
|
| MD5 |
4c19729f9f63cbdd93a1dd22d01fce46
|
|
| BLAKE2b-256 |
2677ce43653e567e8dd9ed03a95f92d31ab944f010e50c25a559fcdf32a1767e
|
Provenance
The following attestation bundles were made for omop_alchemy-0.5.4.tar.gz:
Publisher:
python-publish.yml on AustralianCancerDataNetwork/OMOP_Alchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omop_alchemy-0.5.4.tar.gz -
Subject digest:
dbd70a434d01fb2f0d7de680322a1dbf415e8ccfb5ee72a3dd48ed03b09cac17 - Sigstore transparency entry: 844258120
- Sigstore integration time:
-
Permalink:
AustralianCancerDataNetwork/OMOP_Alchemy@745c7c768faa89a169b5b723e43f042f7e4c22a0 -
Branch / Tag:
refs/tags/0.5.4 - Owner: https://github.com/AustralianCancerDataNetwork
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@745c7c768faa89a169b5b723e43f042f7e4c22a0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file omop_alchemy-0.5.4-py3-none-any.whl.
File metadata
- Download URL: omop_alchemy-0.5.4-py3-none-any.whl
- Upload date:
- Size: 55.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e71906c4debb39d8f8f3b310b2525c87006eba427d7afde812d52ca73813657
|
|
| MD5 |
eb19deb0c20c418d313291cb5e006c93
|
|
| BLAKE2b-256 |
c4fb46495e4f5bf06b0bde95f072f4d3af2acd170f0a8687be378a46db8986f4
|
Provenance
The following attestation bundles were made for omop_alchemy-0.5.4-py3-none-any.whl:
Publisher:
python-publish.yml on AustralianCancerDataNetwork/OMOP_Alchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omop_alchemy-0.5.4-py3-none-any.whl -
Subject digest:
7e71906c4debb39d8f8f3b310b2525c87006eba427d7afde812d52ca73813657 - Sigstore transparency entry: 844258123
- Sigstore integration time:
-
Permalink:
AustralianCancerDataNetwork/OMOP_Alchemy@745c7c768faa89a169b5b723e43f042f7e4c22a0 -
Branch / Tag:
refs/tags/0.5.4 - Owner: https://github.com/AustralianCancerDataNetwork
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@745c7c768faa89a169b5b723e43f042f7e4c22a0 -
Trigger Event:
release
-
Statement type: