Schema validation for evidence submitted to Open Targets
Project description
Open Targets JSON validator
The opentargets-validator
tool in this repository validates JSON files which are submitted to Open Targets by various data sources against the Open Targets JSON schemas.
Installation
pip install --upgrade opentargets-validator
Usage examples
Validating a local gzipped file against the latest schema version from GitHub:
opentargets_validator \
--schema https://raw.githubusercontent.com/opentargets/json_schema/master/schemas/disease_target_evidence.json \
evidence.json.gz
Validating a portion of the local file against a local copy of the schema:
zcat evidence.json.gz | head -n 100 | opentargets_validator --schema evidence_schema.json
Input files
The validator has to be provided with two inputs:
- Data to validate. It has to contain exactly one complete JSON object per line.
- Schema to validate against. It can be any valid JSON Draft 7 schema.
Either of the input files (data and schema) can be read from:
- STDIN (
-
) - Uncompressed remote file (https://example.com/example.json)
- Uncompressed local file (
example.json
) - GZIP-compressed local file (
example.json.gz
)
Development instructions
An editable copy can be installed within a virtual environment:
python -m venv env
source env/bin/activate
pip install -e .[dev]
The tests can be run with:
python -m pytest --cov=opentargets_validator --cov-report term tests/ --fulltrace
Note that you should always use python -m pytest
and not pytest
, because the latter might invoke a system-wide installation (if you have any) and cause incorrect test results.
This repository has Travis integration and CodeCov integration.
Releases are put on PyPI automatically via Travis from GitHub tags.
Project details
Release history Release notifications | RSS feed
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
Hashes for opentargets-validator-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7908b649a82f7d45d2e1e4a32b35e4ae1ffbdd32cb3060e38d2155af45da717f |
|
MD5 | e4ec677ead324a78ae9b00c49d573904 |
|
BLAKE2b-256 | 69d19fb4452139200e3b17286ca1c5c3eaaba4c2b98a836321d85f690a49bb57 |
Hashes for opentargets_validator-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 932dc2f4de60858cc2183f67c8548c250e87d3df2800b93cfd702afd3576cca5 |
|
MD5 | 704165fc27a8c4e334b49d0f763f0dc9 |
|
BLAKE2b-256 | 83ddd3452d4ec60568f319b2c724fb23bbdd67e0dcd6d2d5077861679a2d9d10 |