Evidence string validator.
This tool is intended to validate JSON files that have a single JSON object per line. This is the format that is required from the data sources that provide us with evidence for our target-disease associations.
The validator will check the expected structure, look for missing objects, flag disease IDs that do not start as EFO and Orphanet ID, among other assessments.
Be aware that this is not a general-purpose JSON validator, and use of "pretty-printed" JSON will cause errors.
How to install it
pip install opentargets-validator
How to use it
You have two options
- read from a stdin file (piped one)
- pass as a positional argument and use a zipped or gzipped file (optional)
Read from stdin
cat file.json | opentargets_validator --schema https://raw.githubusercontent.com/opentargets/json_schema/master/src/literature_curated.json
All log messages will be redirected to stderr.
Read from positional argument
Filename extensions could be
Using this option you could use these uri formats
opentargets_validator --schema https://raw.githubusercontent.com/opentargets/json_schema/master/src/literature_curated.json https://where/myfile/is/located.json
How many lines do you want to get printed?
Using the parameter
opentargets_validator will accumulate up to
100 lines and then it will exit.
How to develop it
Within a virtualenv you can install with:
pip install -e .[dev]
and you can run the tests with:
pytest --cov=opentargets_validator --cov-report term tests/ --fulltrace
Releases are put on PyPI.