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()

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.3.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

nmdc_mongo_tools-0.0.3-py2-none-any.whl (6.7 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: nmdc-mongo-tools-0.0.3.tar.gz
  • Upload date:
  • Size: 20.0 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.3.tar.gz
Algorithm Hash digest
SHA256 855fb747f975933938430c58abcd355a3cc00168f7eca6c27d6f0a0186a38754
MD5 72bc5021f5657ae4bd0efb50c0b26c30
BLAKE2b-256 1186200a681e97e01cd9c342ecc58c938cc8eae2e7b3f1fb90e89c8aa8627321

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nmdc_mongo_tools-0.0.3-py2-none-any.whl
  • Upload date:
  • Size: 6.7 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.3-py2-none-any.whl
Algorithm Hash digest
SHA256 47d3825fd3eb027a253a517686069a52c565229f75e8f88e676cb509726db794
MD5 dc51d089cd6f8bcb3f588d1833a7768c
BLAKE2b-256 3f36e8cd40d5377df3de998e7d0b65c849d6841cd8aa5e8a2cc87e8f35d87e00

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