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

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.


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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omop_alchemy-1.1.0.tar.gz (395.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omop_alchemy-1.1.0-py3-none-any.whl (233.8 kB view details)

Uploaded Python 3

File details

Details for the file omop_alchemy-1.1.0.tar.gz.

File metadata

  • Download URL: omop_alchemy-1.1.0.tar.gz
  • Upload date:
  • Size: 395.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for omop_alchemy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d78905132ad0f8933d8d6fceccbac903f497d40a54634ec9193023b237bb5afb
MD5 abd1947e32e1f636121790c5625449bc
BLAKE2b-256 10b6315c72cba081c4cb5fed6737155047667e9057b92307579200551953e248

See more details on using hashes here.

Provenance

The following attestation bundles were made for omop_alchemy-1.1.0.tar.gz:

Publisher: publish.yml on AustralianCancerDataNetwork/omop-alchemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file omop_alchemy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: omop_alchemy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 233.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for omop_alchemy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31b64099145a6183fb71d6d89ecd662a506b5e9f9ab74b0b117860e1085991eb
MD5 31f68bf5f2c5fe18790c2e248f7ea4b5
BLAKE2b-256 a82cc51519b2c1ff3b71b1117ca5e829451cbbe0d77d404d3ff8b485bd3e989c

See more details on using hashes here.

Provenance

The following attestation bundles were made for omop_alchemy-1.1.0-py3-none-any.whl:

Publisher: publish.yml on AustralianCancerDataNetwork/omop-alchemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.12

2 files

0.5.11

2 files

0.5.10

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 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