The common utilities used by the HuMBAP web services
Project description
commons
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
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
Built Distribution
File details
Details for the file hubmap_commons-2.1.17.tar.gz
.
File metadata
- Download URL: hubmap_commons-2.1.17.tar.gz
- Upload date:
- Size: 66.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dd963b0839ece3cb8b62f4176e95cc6a0b39075cf4c1eacc82852bbb4f950d1 |
|
MD5 | 640bcd88d9f9fe5ce8deeef5c920fded |
|
BLAKE2b-256 | 521c58b95ae8c6c1efc91dda7bca49aa13360f9a2d8e8d0c8d7e38c03e79abb0 |
File details
Details for the file hubmap_commons-2.1.17-py3-none-any.whl
.
File metadata
- Download URL: hubmap_commons-2.1.17-py3-none-any.whl
- Upload date:
- Size: 71.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f15d2653977863a24e54a51e518f5455bfaf740947a2792a5d9b02f885347ed |
|
MD5 | c1a29ad4443e85b0a639cb5aa5b04124 |
|
BLAKE2b-256 | 851a2bee66cb64bc63eb301e829a48360dd46beb4b47aa90c889b9b21f99f6da |