Skip to main content

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 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omop-alchemy 3.0.1
File Size Uploaded Provenance Actions
omop_alchemy-3.0.1.tar.gz 759.0 kB With provenance Details for omop_alchemy-3.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for omop-alchemy 3.0.1
File Interpreter ABI Platform Actions
omop_alchemy-3.0.1-py3-none-any.whl Python 3 none any Details for omop_alchemy-3.0.1-py3-none-any.whl

Total release size: 1.1 MB

Release files / omop_alchemy-3.0.1.tar.gz

Download URL omop_alchemy-3.0.1.tar.gz
Size 759.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f31fbd53694d81b4c3615570734090f8925354234458d3b45d8a618fe0e946b2
BLAKE2b-256 checksum
How to use checksums
a44f22055da2c2e6cd4a6091a58805d98130b5771a3e204b63696073300f340c
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 26, 2026.

Transparency log

Release files / omop_alchemy-3.0.1-py3-none-any.whl

Download URL omop_alchemy-3.0.1-py3-none-any.whl
Size 308.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91ae99a9747ea39cd70bf7e6a0cdaaa2dd7367c47067042b1fd051bfa0cc9938
BLAKE2b-256 checksum
How to use checksums
0690dd2bb15e458ce8867ea5ec7d89f5bc934953b0e0ec9a5a098feed5780adb
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 26, 2026.

Transparency log

Security for omop-alchemy 3.0.1

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.

Select from 2 files

Attestation for omop_alchemy-3.0.1.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 26, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page