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>
NMDC_MONGO_DBNAME=<database-name>
, 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
Built Distribution
File details
Details for the file nmdc-mongo-tools-0.0.1.tar.gz
.
File metadata
- Download URL: nmdc-mongo-tools-0.0.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | edcd2a86ad6bd20c42bbf04dd3b25ace05fb7c60442420b59c081298d914e3d8 |
|
MD5 | ed824ae176497be3e659ba123e629f25 |
|
BLAKE2b-256 | 35fb3427745e10a8e8c4d757ed8aebdb6b78e5711e45022c56624b7c69f8542b |
File details
Details for the file nmdc_mongo_tools-0.0.1-py2-none-any.whl
.
File metadata
- Download URL: nmdc_mongo_tools-0.0.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b832658bad5f94499476d2e7c4a7d3775676f65fc50e510920ed4c7de67624ac |
|
MD5 | 55e58aa12440a9c1f669eb054f1e6097 |
|
BLAKE2b-256 | 79b1e70d3e3e2127af03424819b3fabf80221918ed92b4196de4fe09b4a0ba91 |