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.0.0.tar.gz (388.7 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.0.0-py3-none-any.whl (231.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omop_alchemy-1.0.0.tar.gz
  • Upload date:
  • Size: 388.7 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.0.0.tar.gz
Algorithm Hash digest
SHA256 bb74526a09e4a7f26eb16ce6607ebb42c580a3471d2b5f01735e8a8de3deab95
MD5 895b9929f76ac32413670d98d8c19f9e
BLAKE2b-256 89bd22405797161da62d9eefc26614729696ac06a7de67491bb3bf3f6dca352d

See more details on using hashes here.

Provenance

The following attestation bundles were made for omop_alchemy-1.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: omop_alchemy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 231.1 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 121ab13d9e26c49b752a5a4556c99a7c187d9fe7257896dbcdb7ae0fdbb6434c
MD5 0299a9a10464fbd0bac0de51b1882ad7
BLAKE2b-256 2c176ee28f49997b82c3c9a07262ec4a191b6bed7f736b31582cea1d8c52784a

See more details on using hashes here.

Provenance

The following attestation bundles were made for omop_alchemy-1.0.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

1.1.0

2 files

This release

1.0.0 This release

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