Skip to main content

FAIRtracks JSON Validator

Project description

FAIRification Genomic Data Tracks JSON Schema validation, Python edition

The JSON schema should be compliant with JSON Schema Draft04, Draft06 or Draft07 specifications.

So, this validation program uses libraries compliant with that specification.

The installation instructions are in INSTALL.md .

History

The roots of this code come from https://github.com/inab/benchmarking-data-model/tree/0.4.0/toolsForValidation.

Its development was later followed at [https://github.com/fairtracks/fairtracks_validator/], where implementations in other programming languages were also hosted. Python code gained traction and real modularisation there.

As this Python code is relevant to several research projects, it has been split from its latest repo, keeping the core and original extensions at https://github.com/inab/python-extended-json-schema-validator, and keeping these specific FAIRTracks extensions at https://github.com/fairtracks/fairtracks_validator_python.

Usage

python jsonValidate.py --help
usage: fairGTrackJsonValidate.py [-h] [--log-file LOGFILENAME] [--log-format LOGFORMAT] [-q] [-v] [-d] [-V] [-C CONFIGFILENAME]
                                 [--cache-dir CACHEDIR] [--report REPORTFILENAME] [--verbose-report]
                                 [--invalidate | --read-only] [--warm-up | --lazy-load]
                                 json_schema_or_dir [json_file_or_dir [json_file_or_dir ...]]

Validate JSON against JSON Schemas with extensions (version 0.9.7)

positional arguments:
  json_schema_or_dir    The JSON Schema file or directory to validate and use
  json_file_or_dir      The JSON files or directories to be validated

optional arguments:
  -h, --help            show this help message and exit
  --log-file LOGFILENAME
                        Store messages in a file instead of using standard error and standard output
  --log-format LOGFORMAT
                        Format of log messages
  -q, --quiet           Only show engine warnings and errors
  -v, --verbose         Show verbose (informational) messages
  -d, --debug           Show debug messages (use with care, as it could potentially disclose sensitive contents)
  -V, --version         show program's version number and exit
  -C CONFIGFILENAME, --config CONFIGFILENAME
                        Configuration file (used by extensions)
  --cache-dir CACHEDIR  Caching directory (used by extensions)
  --report REPORTFILENAME
                        Store validation report (in JSON format) in a file
  --verbose-report      When this flag is enabled, the report also embeds the json contents which were validated
  --invalidate          Caches are invalidated on startup
  --read-only           When this flag is enabled, the caches are read-only, avoiding expensive operations related to the caches
  --warm-up             Caches are warmed up on startup
  --lazy-load           Caches are warmed up in a lazy way

Next lines run validations using test data:

git clone https://github.com/fairtracks/fairtracks_validator/
python fairGTrackJsonValidate.py fairtracks_validator/test-data/foreignProperty_simple/schemas/ fairtracks_validator/test-data/foreignProperty_simple/good_validation/
python fairGTrackJsonValidate.py fairtracks_validator/test-data/foreignProperty_simple/schemas/ fairtracks_validator/test-data/foreignProperty_simple/bad_validation/

And this is an asciinema recording a previous version of FAIRTracks Validator:

asciicast

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

fairtracks_validator-0.9.8.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fairtracks_validator-0.9.8-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file fairtracks_validator-0.9.8.tar.gz.

File metadata

  • Download URL: fairtracks_validator-0.9.8.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for fairtracks_validator-0.9.8.tar.gz
Algorithm Hash digest
SHA256 a5ae11d2fc0db2e0f25224c77cee5f1434c5c0751b0b7bd3051467cd89796d70
MD5 b0909e66a39625f70f4a4139201a81d7
BLAKE2b-256 e7a584d89153743cae7eaa3943f48fddb623a6387c6320a7923a19913ab10618

See more details on using hashes here.

File details

Details for the file fairtracks_validator-0.9.8-py3-none-any.whl.

File metadata

  • Download URL: fairtracks_validator-0.9.8-py3-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for fairtracks_validator-0.9.8-py3-none-any.whl
Algorithm Hash digest
SHA256 63cb344e283f31b546ca0aeed008a19cf7174ec34897075aed159c2163918d97
MD5 88914caad59381c18388cfc8aee838bc
BLAKE2b-256 905ab3fba1a3fb40d66c93351fe996b3cf0324d750673a3e3568d6bd3001b7cb

See more details on using hashes here.

Supported by

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