Skip to main content

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

nmdc-mongo-tools-0.0.6.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

nmdc_mongo_tools-0.0.6-py2-none-any.whl (6.9 kB view details)

Uploaded Python 2

File details

Details for the file nmdc-mongo-tools-0.0.6.tar.gz.

File metadata

  • Download URL: nmdc-mongo-tools-0.0.6.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

Hashes for nmdc-mongo-tools-0.0.6.tar.gz
Algorithm Hash digest
SHA256 329966a552bdbc71d6926f5dc5bbde33f30a59d9acd380b35b6971872def572e
MD5 6c5c052241e17455c6958ce23056d57a
BLAKE2b-256 6dda946a89ea69350eff67ec380a6f66504a8f40a12f2b6b33ce3f3d9916578c

See more details on using hashes here.

File details

Details for the file nmdc_mongo_tools-0.0.6-py2-none-any.whl.

File metadata

  • Download URL: nmdc_mongo_tools-0.0.6-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

Hashes for nmdc_mongo_tools-0.0.6-py2-none-any.whl
Algorithm Hash digest
SHA256 2bf4d7bec7530b09401d2b64e7d4f8d6fde92dbed79d7be0d81442ce462e1d04
MD5 b24cf6a23e82c557aed9aa424e31fbad
BLAKE2b-256 6bd9012e0745bd1d1f44291092725807fded255812d46804bf30a611fce4cc2b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page