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
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:
- 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
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:
uvfor fast dependency management and buildsrufffor lightning-fast linting and formattinghatchlingas the modern build backendimportlib.resourcesinstead of deprecatedpkg_resources- GitHub Actions for CI/CD instead of Travis CI
pyproject.tomlfor modern Python project configuration
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f02b5bbb140fefabf39c4fe77dc81a0a23fd03a487d2d2eb4d081d77995f5cd
|
|
| MD5 |
cb3561f1193b826687160e889cb4d59d
|
|
| BLAKE2b-256 |
97ce7774066125bf1cd3109d0277f7f93aa552cf34b0c29ee61eaf67efd08b9a
|
Provenance
The following attestation bundles were made for opentargets_validator-1.0.1.tar.gz:
Publisher:
build-release.yaml on opentargets/validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opentargets_validator-1.0.1.tar.gz -
Subject digest:
1f02b5bbb140fefabf39c4fe77dc81a0a23fd03a487d2d2eb4d081d77995f5cd - Sigstore transparency entry: 493368677
- Sigstore integration time:
-
Permalink:
opentargets/validator@b93a7c83217572149d7cb1241b6b51378e9f8acf -
Branch / Tag:
refs/heads/master - Owner: https://github.com/opentargets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yaml@b93a7c83217572149d7cb1241b6b51378e9f8acf -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file opentargets_validator-1.0.1-py3-none-any.whl.
File metadata
- Download URL: opentargets_validator-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5aea06b05cbc350cfd7c22fc19bc290c97f9a0042ef4e9afbd8b86f4f0acb203
|
|
| MD5 |
c623aaf5510525af871059fce2885d5f
|
|
| BLAKE2b-256 |
7a37596b35f483d14ce9c7dc2bc31165129e9d905716f0e04d1a7c7cebeffc14
|
Provenance
The following attestation bundles were made for opentargets_validator-1.0.1-py3-none-any.whl:
Publisher:
build-release.yaml on opentargets/validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opentargets_validator-1.0.1-py3-none-any.whl -
Subject digest:
5aea06b05cbc350cfd7c22fc19bc290c97f9a0042ef4e9afbd8b86f4f0acb203 - Sigstore transparency entry: 493368705
- Sigstore integration time:
-
Permalink:
opentargets/validator@b93a7c83217572149d7cb1241b6b51378e9f8acf -
Branch / Tag:
refs/heads/master - Owner: https://github.com/opentargets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yaml@b93a7c83217572149d7cb1241b6b51378e9f8acf -
Trigger Event:
workflow_dispatch
-
Statement type: