Skip to main content

Schema validation for evidence submitted to Open Targets

Project description

PyPI version Build Status codecov

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:

  1. Data to validate. It has to contain exactly one complete JSON object per line.
  2. 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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentargets-validator-1.0.0.tar.gz (10.2 kB view hashes)

Uploaded Source

Built Distribution

opentargets_validator-1.0.0-py3-none-any.whl (10.9 kB view hashes)

Uploaded Python 3

Supported by

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