Skip to main content

A set of common utilities and helpers for CHORD.

Project description

CHORD Library (for Python CHORD microservices)

Build Status codecov PyPI version

Common utilities and helpers for CHORD services.

Running Tests

python3 -m tox

Releasing

1. Release Checklist

  • All tests pass and test coverage has not been reduced

  • Package version has been updated (following semver) in chord_lib/package.cfg

  • The latest changes have been merged from the develop branch into the master branch

  • A release has been created, tagged in the format of v#.#.# and named in the format of Version #.#.#, listing any changes made, in the GitHub releases page tagged from the master branch!

2. Releasing from the Command Line

# IF NECESSARY: Install twine OUTSIDE of the virtual environment
python3 -m pip install twine

# Switch to the correct branch and make sure it's up to date
git checkout master
git pull

# If needed, enter the project virtual environment
source env/bin/activate

# Remove existing build files
rm -rf build/ dist/ chord_lib.egg-info/

# Build the new package
python3 setup.py sdist bdist_wheel

# In between these steps - test out the package... make sure everyhting works
# before uploading it to production PyPI.

# Upload it to PyPI
python3 -m twine upload dist/*

Modules

auth

auth provides Python service decorators and Django / DRF backends for dealing with the CHORD container authentication headers (derived from lua-resty-openidc, set by the internal container NGINX instance.)

events

events facilitates JSON-serialized message-passing between CHORD microservices. Serialized objects can be at most 512 MB.

Events should have a lower-case type which is type-insensitively unique and adequately describes the associated data.

All CHORD channels are prefixed with chord..

ingestion

ingestion contains common code used for handling ingestion routines in different CHORD data services.

schemas

schemas contains common JSON schemas which may be useful to a variety of different CHORD services.

schemas.chord contains CHORD-specific schemas, and schemas.ga4gh contains GA4GH-standardized schemas (possibly not exactly to spec.)

search

search contains definitions, validators, and transformations for the query syntax for CHORD, as well as a transpiler to the psycopg2 PostgreSQL IR.

The query syntax for CHORD takes advantage of JSON schemas augmented with additional properties about the field's accessibility and, in the case of Postgres, how the field maps to a table column (or JSON column sub-field.)

search.data_structure contains code for evaluating a CHORD query against a Python data structure.

search.operations contains constants representing valid search operations one can allow against particular fields from within an augmented JSON schema.

search.postgres contains a "transpiler" from the CHORD query syntax to the psycopg2-provided intermediate representation (IR) for PostgreSQL, allowing safe queries against a Postgres database.

search.queries provides definitions for the CHORD query AST and some helper methods for creating and processing ASTs.

utils

utils contains miscellaneous utilities commonly required by CHORD services.

workflows

workflows contains common code used for handling workflow metadata processing and response generation.

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

chord_lib-0.7.0.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

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

chord_lib-0.7.0-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file chord_lib-0.7.0.tar.gz.

File metadata

  • Download URL: chord_lib-0.7.0.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/36.5.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0

File hashes

Hashes for chord_lib-0.7.0.tar.gz
Algorithm Hash digest
SHA256 b55a35c6c72c8776bec8730df1c69998a87af53f64e66588c56438f96e1f80b5
MD5 c2080f496041e211ed1d203625a8eaae
BLAKE2b-256 80fc333184a5232790684c03be1f86407fabdf29acf92ccb3ceb5c8a5794e343

See more details on using hashes here.

File details

Details for the file chord_lib-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: chord_lib-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 41.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/36.5.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0

File hashes

Hashes for chord_lib-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 746df93e5845baf4754423fa959cc8afc1b3427d036fa0481deb55405c58d1c8
MD5 769019916f72b9e4679a4ee062c3c875
BLAKE2b-256 ddb0ff74c0336b20fd2a3009679084ef68d25b50dec8f06773dd554fb129bf2c

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