Tools for validation and storage of JSON data using the NMDC Schema
Project description
Tools for validation and storage of JSON data using the NMDC Schema.
Getting Started
pip install nmdc-mongo-tools
Create a .env
file in your working directory and add the following lines to it:
NMDC_JSON_SCHEMA_URL=https://raw.githubusercontent.com/microbiomedata/nmdc-metadata/master/schema/nmdc.schema.json
NMDC_MONGO_HOST=<host>
NMDC_MONGO_USERNAME=<username>
NMDC_MONGO_PWD=<password>
, setting appropriate values for connecting to a MongoDB instance. As an alternative to NMDC_JSON_SCHEMA_URL
, you may
set NMDC_JSON_SCHEMA_FILE
to be the path to your local copy of the NMDC Schema JSON file. You may also set your
environment variables any other way -- the .env
-file approach is supported but not required.
Then, import from the nmdc_mongo
package, e.g.
from nmdc_mongo import get_db
db = get_db("dwinston_share")
db.list_collection_names()
# ['metagenome_assembly_set', 'omics_processing_set', 'metaproteomics_analysis_activity_set', 'mags_activity_set',
# 'read_QC_analysis_activity_set', 'nom_analysis_activity_set', 'biosample_set', 'read_based_analysis_activity_set',
# 'study_set', 'metabolomics_analysis_activity_set', 'metagenome_annotation_activity_set', 'data_object_set',
# 'raw.functional_annotation_set']
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
Built Distribution
File details
Details for the file nmdc-mongo-tools-0.0.7.tar.gz
.
File metadata
- Download URL: nmdc-mongo-tools-0.0.7.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 256cfa84475de4b8bd0af1fba3a2d66b51b2d22b56f26d0d1e4f1b57e0a9cfb8 |
|
MD5 | 7e1ba0a3e38955657b1ce0a18c7cf04f |
|
BLAKE2b-256 | 4c590a8717c5cce902905e64a75fdcc861b415d4732be7785664066b7c17cc12 |
File details
Details for the file nmdc_mongo_tools-0.0.7-py2-none-any.whl
.
File metadata
- Download URL: nmdc_mongo_tools-0.0.7-py2-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4722e28a126d62de76ad6ac424336acbda011f6273072f52f3a3e7bcf4ef4edf |
|
MD5 | 6d2475e98d0814c2bdae8b726881b24d |
|
BLAKE2b-256 | 606587f477cd8892132c3c08c856b1223a8c2d9984e9bd755a7a8dd853c625a8 |