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 1.2.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 1.2.1
File Size Uploaded
omop_alchemy-1.2.1.tar.gz 694.5 kB Details

Built distribution (wheel)

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

Total release size: 974.3 kB

Release files / omop_alchemy-1.2.1.tar.gz

Download URL omop_alchemy-1.2.1.tar.gz
Size 694.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b79c0a5c845ef1bd7530171718f7a7fed7336e7f585488016af2fa4ffb17327f
BLAKE2b-256 checksum
How to use checksums
879460f7843da2ba55c3d3b6adc6be79c55a69d271e8baa3509f8c89033cf569
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 6, 2026.

Transparency log

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

Download URL omop_alchemy-1.2.1-py3-none-any.whl
Size 279.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25e6831979fe96c18fe3a76daa26561ac2de32e64c8ac16931b7af110cc882cf
BLAKE2b-256 checksum
How to use checksums
3526b1d08996d96baf25af14c06d89c9738d634ba31272a3b58f9c3455076d06
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 6, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.0

2 release files

1.2.2

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.12

2 release files

0.5.11

2 release files

0.5.10

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

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