Git Product home page Git Product logo

sqlalchemy_omopcdm's Introduction

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.

Footnotes

  1. Python Packaging User Guide: Package name normalization

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

sqlalchemy_omopcdm's People

Contributors

actualben avatar dependabot[bot] avatar

Watchers

 avatar  avatar  avatar  avatar

sqlalchemy_omopcdm's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.