Skip to main content

A set of common utilities and helpers for Bento platform services.

Project description

Bento Library (for Python Bento microservices)

Test Status Lint Status codecov PyPI version

Common utilities and helpers for Bento platform services.

Running Tests

For tests to complete successfully, the following external servers must be running:

  • A Redis server at localhost:6379
  • A Postgres server at localhost:5432 with peer access for the postgres role/database

Then, tests and linting can be run with the following command:

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 bento_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!

1A. Note on Versioning

The bento_lib project uses semantic versioning for releasing. If the API is broken in any way, including minor differences in the way a function behaves given an identical set of parameters (excluding bugfixes for unintentional behaviour), the MAJOR version must be incremented. In this way, we guarantee that projects relying on this API do not accidentally break upon upgrading.

2. Releasing automatically

When a version is tagged on GitHub, a build + release CI pipeline is automatically triggered. Make sure that the tagged version is a valid semantic versioning translation of the version in package.cfg, and that the versions otherwise match.

Modules

auth

auth provides Python service middleware for dealing with the Bento authorization service.

db

db contains common base classes for setting up database managers.

drs

drs provides utilities for fetching data and record metadata from GA4GH-compatible DRS services, and Bento's own implementation (which has some non-standard extensions.)

events

events facilitates JSON-serialized message-passing between Bento 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 Bento channels are prefixed with bento..

logging

logging contains helper functions for standardized Bento logging configuration and formatting.

responses

responses contains standardized error message-generating functions and exception handling functions for different Python web frameworks.

schemas

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

schemas.bento contains Bento-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 Bento, as well as a transpiler to the psycopg2 PostgreSQL IR.

The query syntax for Bento 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 Bento 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 Bento query syntax to the psycopg2-provided intermediate representation (IR) for PostgreSQL, allowing safe queries against a Postgres database.

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

service_info

service_info contains Python typed dictionaries, Pydantic models, and helpers for common structures and operations related to GA4GH's /service-info specification.

workflows

workflows contains common code used for handling workflow metadata processing and response generation, as well as code associated with Bento's ingestion routines across the different data services.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

bento_lib-11.1.2.tar.gz (46.6 kB view details)

Uploaded Source

Built Distribution

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

bento_lib-11.1.2-py3-none-any.whl (84.2 kB view details)

Uploaded Python 3

File details

Details for the file bento_lib-11.1.2.tar.gz.

File metadata

  • Download URL: bento_lib-11.1.2.tar.gz
  • Upload date:
  • Size: 46.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bento_lib-11.1.2.tar.gz
Algorithm Hash digest
SHA256 ad231e0bd6f00b80c9fa7cd2857885afb936fd019f58a595facfb3cf8fdcb09a
MD5 81c69ca9faf5f7a895f6c4de401446d1
BLAKE2b-256 1839886de5bff1ebd51e78f1ae7cb976b96272c0c4763a441fb32834537e7b15

See more details on using hashes here.

File details

Details for the file bento_lib-11.1.2-py3-none-any.whl.

File metadata

  • Download URL: bento_lib-11.1.2-py3-none-any.whl
  • Upload date:
  • Size: 84.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bento_lib-11.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b588284f8ac72916a0882daa1240ae62bae6225b391f1451ce47a717cb506981
MD5 c7670866488ca75727b62b85e90c6719
BLAKE2b-256 e49ce89fe4a1fa2deef334a7644bcd68d310138309b56cc23be42240d4b9d92c

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