Skip to main content

The common utilities used by the HuMBAP web services

Project description

commons

PyPI version

This repository contains the code supporting several HuBMAP restful microservices.

Getting Started

The hubmap commons library is available through PyPi via the command:

pip install hubmap-commons

The hubmap-commons requirements can be found here

Contents

The code includes:

  • activity.py (deprecated) creates Cyhper statements for creating and getting HuBMAP Activitiy node types

  • autherror.py a class to handle authentiation errors

  • entity.py(deprecated) a base class that executes many Cypher queries against Neo4j to return information about the HuBMAP Entity nodes

  • file_helper.py contains methods to execute files and parse files

  • globus_file_helper.py contains methods for creating Globus directories

  • hm_auth.py contains several methods and classes relating to system security

  • hubmap_const.py a file that maintains the names and strings used in the code and the Neo4j system

  • neo4j_connection.py(deprecated) provides connections to Neo4j and some generic Cypher statements (e.g. CREATE and UPDATE)

  • neo4j_driver.py creates a neo4j.Driver singleton instance

  • provenance.py(deprecated) extracts provenance related information from a token

  • schema_tools.py checks a JSON structure vs a schema definition using two main methods.

    • check_json_matches_schema(jsondata, schema_filename: str, base_path: str = "", base_uri: str = "") Checks the given json data against the jsonschema in the given schema file, raising an exception on error. The exception text includes one or more validation error messages.
    • assert_json_matches_schema(jsondata, schema_filename: str, base_path: str = "", base_uri: str = "") Raises AssertionError if the schema in schema_filename is invalid, or if the given jsondata does not match the schema.
  • stirng_helper.py contains several string related functions (listToCommaSeparated, getYesNo, etc.)

  • test_ws.py contains a test Web Service. This service can be run by copying hubmap_commons/common_app.conf.example to hubmap_commons/common_app.conf and providing a Globus client id and secret (available at https://developers.globus.org) then directly running test_ws.py from the hubmap_commons/ directory. The service has a useful /login method that can be used to generate Globus auth tokens for testing. Note: For much of HuBMAP a Globus "nexus" token used to access the globus Nexus APIs. To generate a nexus token the Client ID must be authorized for this. Client IDs are available from the developers of this repository to generate nexus tokens for use against HuBMAP APIs.

  • uuid_generator.py(deprecated) this is a wrapper for calls to the /hmuuid Web Service

  • type_cliet.py(deprecated and removed) provides a singleton client for retrieving information about different assay types

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

hubmap_commons-2.1.23.tar.gz (64.0 kB view details)

Uploaded Source

Built Distribution

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

hubmap_commons-2.1.23-py3-none-any.whl (69.2 kB view details)

Uploaded Python 3

File details

Details for the file hubmap_commons-2.1.23.tar.gz.

File metadata

  • Download URL: hubmap_commons-2.1.23.tar.gz
  • Upload date:
  • Size: 64.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for hubmap_commons-2.1.23.tar.gz
Algorithm Hash digest
SHA256 e4bf00c5e2d844aa45195623cfea1d191e70b1095f44340c2eb123d22973c7d6
MD5 129ccddd54da9b0640055c063c7b5048
BLAKE2b-256 89f15f9e391a78dd9348befe527fe52f44d5e55379e6b39bc7db14aab3c37c10

See more details on using hashes here.

File details

Details for the file hubmap_commons-2.1.23-py3-none-any.whl.

File metadata

File hashes

Hashes for hubmap_commons-2.1.23-py3-none-any.whl
Algorithm Hash digest
SHA256 3cf47c3aed39478fcd1667d0eb4bf9964563115f092e059ee930e827ef84284c
MD5 27c86a4db4c027405930b7cd63fb5c83
BLAKE2b-256 35d1a891024f8b2a6c7381d2162b229e6f79068311867e2d977ec176677823d4

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