Skip to main content

Work with ODM as Python objects

Project description

odmlib

Introduction

The odmlib package simplifies working with the CDISC ODM data exchange standard and its extensions, such as Define-XML, in Python. The odmlib package provides an object-oriented interface for working with ODM documents that simplifies creating and processing them. It supports serializations in XML and JSON. ODM models have been created for ODM 1.3.2, Define-XML versions 2.0 and 2.1, Dataset-XML 1.0.1, and CT-XML 1.1.1. An ODM v2.0 draft will be delivered once the specification has been completed.

Odmlib simplifies the act of creating propriety extensions and automatically serializing them as XML or JSON. Odmlib also supports conformance checks and schema validation to ensure quality and standards compliance. My new blog has some posts highlighting odmlib and odmlib example programs.

Why odmlib?

The odmlib package satisfies my personal interest in working with ODM using an object-oriented interface in Python.

Getting Started

Since odmlib is still in development the best way to proceed is to clone the odmlib repository, switch to the odmlib directory, and run

python setup.py install

Alternatively, for those that may want to contribute to the development of odmlib, run

python setup.py develop

For those running PyCharm on Windows, here are the steps to install odmlib for development:

  1. switch to venv\scripts
  2. run activate.bat
  3. switch to odmlib directory
  4. run: python setup.py develop

When running PyCharm on Linux:

  1. switch to venv/bin
  2. run activate (set permissions if needed)
  3. switch to odmlib directory
  4. run: python setup.py develop

The odmlib package requires that some packages be installed:

  • validators
  • pathvalidate
  • cerberus

Although odmlib is still under development, a version of odmlib is available on PyPI. Although not the most up-to-date, it’s the easiest to install:

pip install odmlib

Example Code

Example code is available in the odmlib_examples repository that demonstrate ways to use odmlib. Selected examples include:

  • get_started: a basic example that shows how to create and process a basic ODM metadata file
  • xlsx2define2-1: generates a Define-XML v2.1 file from a metadata spreadsheet
  • define2-1-to-xlsx: generates a metadata spreadsheet from a Define-XML v2.1 file
  • merge_odm: simple merge application that generates a target ODM file with a CRF moved from a source ODM file
  • notebooks: basic Jupyter notebooks that walk you through creating an initial Define-XML v2.1 or ODM file
  • library_xml: demonstrates using odmlib with the CDISC Library and creating a customized model

Limitations

The odmlib package is still in development. It is being used in several projects and is going through additional testing so there will be periodic updates. The initial focus has been on getting the metadata sections tested as this is where it's currently getting the most use. If an odmlib_example program stops working you should look into updating odmlib and / or the odmlib_example program as you may be missing an update.

Limitations include:

  • No support for ItemData[Type]. This could easily be added, but the default ODM v1.3.2 model packaged with odmlib does not include ItemData[Type]. ItemData[Type] will be deprecated in ODM v2.0.
  • No support for ds:Signature. This can also be added if needed.
  • The plan is to generate the oid def/ref checks dynamically. The first cut have been developed manually. Until the code to generate the checks dynamically is written, the checks must be manually created for each new model.
  • The odm_loader returns the first MetaDataVersion by default, but can be set to return others. It does not return a list.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odmlib-0.1.4.tar.gz (257.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odmlib-0.1.4-py3-none-any.whl (311.1 kB view details)

Uploaded Python 3

File details

Details for the file odmlib-0.1.4.tar.gz.

File metadata

  • Download URL: odmlib-0.1.4.tar.gz
  • Upload date:
  • Size: 257.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

File hashes

Hashes for odmlib-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3b4c31ccf4b68a2c5f1cbe0265a44fe40556f9b3e650efe5846662ae31b96a51
MD5 8139070ac5f2293f1de0521f51078164
BLAKE2b-256 257b60a82f027eaf462e3da3b7daa31f903cee93aaf1a0e26c4a747d5303fe6f

See more details on using hashes here.

File details

Details for the file odmlib-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: odmlib-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 311.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

File hashes

Hashes for odmlib-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 712e9204013a80923607f453ec5266fd05a0b7cae2a3b96ba35d2e1bcb57624d
MD5 02e08583b9e0105d3368a64eec5413bf
BLAKE2b-256 f0ce15da461c1b996144b459882a6affd097a21737b19077a3a5f064b40bd4e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page