Skip to main content

DZD - OMOP CDM Python ORM/Data Classes Representation

A Python ORM/data classes representation of the Observational Medical Outcomes Partnership (OMOP) Common Data Model (CDM) in different flavors powered by sqlacodegen

Author/Maintainer: Tim Bleimehl

For more background how this sausage is made have a look at the github repo at https://github.com/DZD-eV-Diabetes-Research/dzd-omop-cdm-python-models

This Readme is a "work in process". Come back later for a more complete manual.

Install

Just install the python module from pypi.org

python -m pip install --upgrade dzdomop

How to use

This tiny script demostrates how this module can help you to

  • Create a local dev database with the complete omop datamodel
  • insert some data based on our classes with some basic guardrails like type validation, typo prevention, ...
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from omopmodel import OMOP_5_3_declarative as omop

# Create a local SQLite database with all OMOP CDM tables+properties
engine = create_engine("sqlite:///cdm_source.db", echo=True)
omop.Base.metadata.create_all(engine)

# Create a some basic OMOP objects
care_site = omop.CareSite(care_site_id=5678, care_site_name="St. Local")
person = omop.Person(
    person_id=1234,
    year_of_birth=1985,
    care_site=care_site,
    gender_concept_id=1,
    race_concept_id=1,
    ethnicity_concept_id=1,
)

# Write the Object to the database
with Session(engine) as session:
    session.add(care_site)
    session.add(person)
    session.commit()

Release files for dzdomop 0.4.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 dzdomop 0.4.0
File Size Uploaded
dzdomop-0.4.0.tar.gz 341.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dzdomop 0.4.0
File Interpreter ABI Platform
dzdomop-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 690.2 kB

Release files / dzdomop-0.4.0.tar.gz

Download URL dzdomop-0.4.0.tar.gz
Size 341.9 kB
Tags Source
SHA-256 checksum
How to use checksums
aafed26355bdace1e6c1a4878d01e38cb366ff517d5d230546dc1b6c301703da
BLAKE2b-256 checksum
How to use checksums
0ac9dfc770a6e8ddbc7c34b3684e329f17deb6e45c94dec0dff221d90f846970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / dzdomop-0.4.0-py3-none-any.whl

Download URL dzdomop-0.4.0-py3-none-any.whl
Size 348.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b26d84fd1048cde95856a484e49baa4da63fea64b31cdf79f6f6d3111858cfe1
BLAKE2b-256 checksum
How to use checksums
245cc0cce868c6b4c75216b571d6a7e4e368d048cbddcdfb1c928c35201efb8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.5

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