Skip to main content

sqlalchemy-omopcdm

Repo URL
PyPI https://pypi.org/project/sqlalchemy-omopcdm/
GitHub https://github.com/edencehealth/sqlalchemy_omopcdm

Install via:

pip install sqlalchemy-omopcdm

About

This package contains Declarative Mapping-based SQLAlchemy 2 models for each table in the OMOP CDM, including primary keys, indexes, and constraints. These models can be used to work with OMOP CDM databases - including the ability to initialize and query them.

The models in this repo are automatically created using the sqlacodegen-based sqlalchemy_omopcdm_modelgen container image.

Important Note: In order to use Declarative Mapping, each table needs at least one column with primary key behavior, to achieve this we have added 11 unofficial & unsupported composite primary keys on the following tables: cdm_source, cohort_definition, cohort, concept_ancestor, concept_relationship, concept_synonym, death, drug_strength, episode_event, fact_relationship, source_to_concept_map

Naming

Python naming can be complicated 12. To make it clear for this repo, the distribution name is sqlalchemy-omopcdm (with a dash) and the package name is sqlalchemy_omopcdm (with an underscore).

When you install the package, use:

pip install sqlalchemy-omopcdm

When you access the package in code, use:

from sqlalchemy_omopcdm import CareSite

Model Generation

You can recreate the output file with the following command:

docker compose run --rm modelgen

This single command will bring up the database, load the DDL into it, build the modelgen container, and run it against the database. The result is written to the output dir.

  1. Python Packaging User Guide: Package name normalization ↩

  2. stackoverflow: Using hyphen/dash in python repository name and package name ↩

Metadata

Release files for sqlalchemy-omopcdm 0.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 sqlalchemy-omopcdm 0.2.0
File Size Uploaded
sqlalchemy-omopcdm-0.2.0.tar.gz 34.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-omopcdm 0.2.0
File Interpreter ABI Platform
sqlalchemy_omopcdm-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 68.0 kB

Release files / sqlalchemy-omopcdm-0.2.0.tar.gz

Download URL sqlalchemy-omopcdm-0.2.0.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2b86b395c3593ced816eb3a37758a987d32a6d12ce2b40cdb0d47a22d5d4e96c
BLAKE2b-256 checksum
How to use checksums
b55c086402052b89ac86ee828216d2ecfec967d708b0cebc0f333001f3f05ea0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / sqlalchemy_omopcdm-0.2.0-py3-none-any.whl

Download URL sqlalchemy_omopcdm-0.2.0-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
675fb29add8befee137e4d885df86efdcda728482c7bda3bc2640a10a467403f
BLAKE2b-256 checksum
How to use checksums
57b74a502ff7e03ce62c6c42df237fcc2b7eafa220af811114667bb23b7b4cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

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