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

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.0
File Size Uploaded
omop_alchemy-1.2.0.tar.gz 691.7 kB Details

Built distribution (wheel)

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

Total release size: 971.0 kB

Release files / omop_alchemy-1.2.0.tar.gz

Download URL omop_alchemy-1.2.0.tar.gz
Size 691.7 kB
Tags Source
SHA-256 checksum
How to use checksums
689b789e4a39cd63394dea6f2d4bd06f2195744dafee0d42670cabc1dea4339c
BLAKE2b-256 checksum
How to use checksums
edf16d075fdc151734ec67c678e8ee76c14d6a994e173ac474aceb23af3c671d
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 Sep 18, 2026.

Transparency log

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

Download URL omop_alchemy-1.2.0-py3-none-any.whl
Size 279.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9402ad34a011c43609b65a56baff8c50b7d8f3b7ba99f6110d6b2593c1db8995
BLAKE2b-256 checksum
How to use checksums
75907b34ba5d9ffca12a074a4b5a94ec1dcd9a6bc3ec5f5581736bb56be9b095
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 Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

This release

1.2.0 This release

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