Skip to main content

InspectOMOP

Latest Release latest release
Package Status status
License license
Usage Stats usage

What is it?

inspectomop is a lightweight python 3 package that assists in the extraction of electronic health record(EHR) data from relational databases following the OHDSI OMOP Common Data Model(CDM) standard v>=5.

  • OHDSI: Observational Health Data Sciences and Informatics
  • OMOP: Observation Medical Outcomes Partnership

Why was this built?

A large portion of data science research is spent on ETL (Extraction, Transformation, and Loading). If the data are stored in a relational database, the first step includes deciphering the database schema and figuring out how to write SQL queries that will properly gather the information of interest. This can be both laborious and time consuming. inspectomop attempts to simplify extracting data from the OMOP CDM with an API that is easy to use, extensible, and SQL dialect agnostic.

One of the main benefits of adopting a CDM such as OMOP is that it promotes the sharing of ideas and methodology. Queries in inspectomop are simple python functions so using sqlAlchemy any user can create custom queries that can be shared across institutions and database management systems.

def my_query(inputs, inspector):

    # create SQL agnostic query usually of the form

    statement = select([columns]).where(inputs == criteria)

    return inspector.execute(statement)

Who is this for?

inspectomop is for any python 3 programmer with an interest in interfacing with an EHR relational database formatted to follow the OMOP CDM standard.

The OHDSI group has developed an excellent library of tools and methods written in R, but there are few, if any tools, for the python community.

Features

  • SQL dialect agnostic thanks to SQLAlchemy allowing for a variety of compatible database back ends
  • automatic reflection of DB tables to dot accessible python objects for easy traversal and inspection
  • preloaded with standard queries from the OHDSI group
  • results returnable as pandas dataframes or dataframe chunks for queries with a large number of rows
  • extensibility with custom queries built from simple python functions

SQL Dialect Compatibility

Below is a table comparing SQL dialect support for inspectomop versus the R SQLRender package written and maintained by the OHDSI group.

dialect inspectomop (python) SQLRender (R)
BigQuery No * Yes
Impala Yes * Yes
Netezza No * Yes
Oracle Yes Yes
PostgreSQL Yes Yes
Redshift Yes * Yes
SQL Server Yes Yes
SQLite Yes Unknown

Note: Compatibility is primarily based on the availability of dialects written for SQLAlchemy. Most have not bee explicitly tested by the author with the exception of SQLite v2.6.0 and SQL Server 2016 Service Pack 1 (13.0.4001.0). However, success stories and troubleshooting questions are welcome!

* BigQuery : python DB-API, but no sqlalchemy dialect as of 8/17/2018 (https://github.com/GoogleCloudPlatform/google-cloud-python/issues/3603)

* Impala : external dialect available via impyla package

* Netezza : python DB-API, but no sqlalchemy dialect as of 8/17/2018

* Redshift : external dialect available via sqlalchemy-redshift package

Where to get it

  • install from PyPI using pip with
pip install inspectomop

Dependencies

* Developed using SQLAlchemy 1.2.1 and Pandas 0.22.0

Documentation

Read the official documentation hosted on readthedocs for more information on usage and examples.

License

Feel free to fork, copy, share and contribute. This software released under GNU Affero GPL v3.0

Release files for inspectomop 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inspectomop 0.2.3
File Size Uploaded
inspectomop-0.2.3.tar.gz 434.0 kB Details

Built distribution (wheel)

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

Total release size: 863.8 kB

Release files / inspectomop-0.2.3.tar.gz

Download URL inspectomop-0.2.3.tar.gz
Size 434.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0a8c4bb165ed63a271930deeb7e5cbfba8f350385bd292e217321aee0fbef686
BLAKE2b-256 checksum
How to use checksums
4a1b40688665765608fbbcdc7c95f7da1180f992d42bed060dd5f7ef4eee592c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / inspectomop-0.2.3-py3-none-any.whl

Download URL inspectomop-0.2.3-py3-none-any.whl
Size 429.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13a74d728f89b14d83cb2a699b465495b88c31e153cbb6171b9dfba098bee63b
BLAKE2b-256 checksum
How to use checksums
7758008dceaf637379f8302d82cc7157e9e16723c477a1455b7fae567db2ad4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

4 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