No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
opentargets_validator
tests
.gitignore
.travis.yml
Dockerfile
LICENSE
MANIFEST.in
README.md
requirements.txt
setup.cfg
setup.py

README.md

PyPI version

Build Status

codecov

Docker Repository on Quay.io

opentargets-validator

Evidence string validator.

Purpose

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 .[json|json.zip|json.zip]

Using this option you could use these uri formats

  • http[s]://file/location/name.json
  • file://relative/local/file.json
  • file:///absolute/file.json
  • location/file.json
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 --log-lines 100, 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

This repository has Travis integration and CodeCov integration .

Releases are put on PyPI.