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.9.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.9-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fairtracks_validator-0.9.9.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.9.tar.gz
Algorithm Hash digest
SHA256 0a5f4d3363b9c40de657a0ca1999a35422f44df4383b3c786ab4c5d8bb93a1f4
MD5 5bae1b1513638fa5b3f096cc454ce983
BLAKE2b-256 d348f3c652de92c80abefbf7f57310b2833f7eb7439da07eba6ef3d0f833e575

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fairtracks_validator-0.9.9-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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f1f723950055ccbae07fb6f0200b5be2942595164bb20a17aa736c4fb1679595
MD5 cc5c276199343f03ef9e75cbb3dfed8f
BLAKE2b-256 0349cf65f9607a3cd458d1844609ee598800a73edbc64ad77f66c97d22db41b0

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