Skip to main content

Schema validation for evidence submitted to Open Targets

Project description

PyPI version CI

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

Requirements

  • Python 3.8.1 or higher
  • Compatible with Python 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13

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

Quick start with uv (recommended)

# Install uv and dependencies
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --dev

# Run tests and linting
uv run pytest
uv run ruff check opentargets_validator tests

Using pip

python -m venv env && source env/bin/activate
pip install -e ".[dev]"
python -m pytest

CI/CD and Releases

This repository uses GitHub Actions for continuous integration.

Releases are automatically published to PyPI via GitHub Actions when tags are created.

Modern Python Tooling

This project has been modernized with:

  • uv for fast dependency management and builds
  • ruff for lightning-fast linting and formatting
  • hatchling as the modern build backend
  • importlib.resources instead of deprecated pkg_resources
  • GitHub Actions for CI/CD instead of Travis CI
  • pyproject.toml for modern Python project configuration

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.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opentargets_validator-1.0.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file opentargets_validator-1.0.1.tar.gz.

File metadata

  • Download URL: opentargets_validator-1.0.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opentargets_validator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1f02b5bbb140fefabf39c4fe77dc81a0a23fd03a487d2d2eb4d081d77995f5cd
MD5 cb3561f1193b826687160e889cb4d59d
BLAKE2b-256 97ce7774066125bf1cd3109d0277f7f93aa552cf34b0c29ee61eaf67efd08b9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentargets_validator-1.0.1.tar.gz:

Publisher: build-release.yaml on opentargets/validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opentargets_validator-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opentargets_validator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5aea06b05cbc350cfd7c22fc19bc290c97f9a0042ef4e9afbd8b86f4f0acb203
MD5 c623aaf5510525af871059fce2885d5f
BLAKE2b-256 7a37596b35f483d14ce9c7dc2bc31165129e9d905716f0e04d1a7c7cebeffc14

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentargets_validator-1.0.1-py3-none-any.whl:

Publisher: build-release.yaml on opentargets/validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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