Metadata-Version: 2.4
Name: opentargets-validator
Version: 1.0.1
Summary: Schema validation for evidence submitted to Open Targets
Project-URL: Homepage, https://github.com/opentargets/validator
Project-URL: Repository, https://github.com/opentargets/validator
Project-URL: Documentation, https://github.com/opentargets/validator#readme
Project-URL: Bug Tracker, https://github.com/opentargets/validator/issues
Author-email: Open Targets <data@opentargets.org>
Maintainer-email: Open Targets <data@opentargets.org>
License: Apache-2.0
License-File: LICENSE
Keywords: bioinformatics,opentargets,python3
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8.1
Requires-Dist: fastjsonschema>=2.18.0
Requires-Dist: pathos>=0.3.1
Provides-Extra: build
Requires-Dist: build; extra == 'build'
Requires-Dist: twine; extra == 'build'
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: codecov; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Requires-Dist: uv; extra == 'dev'
Provides-Extra: lint
Requires-Dist: mypy; extra == 'lint'
Requires-Dist: ruff; extra == 'lint'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-xdist; extra == 'test'
Description-Content-Type: text/markdown

[![PyPI version](https://badge.fury.io/py/opentargets-validator.svg)](https://badge.fury.io/py/opentargets-validator)
[![CI](https://github.com/opentargets/validator/workflows/CI/badge.svg)](https://github.com/opentargets/validator/actions/workflows/ci.yml)

# Open Targets JSON validator
The `opentargets-validator` tool in this repository validates JSON files which are submitted to Open Targets by various [data sources](https://platform-docs.opentargets.org/evidence) against the Open Targets [JSON schemas](https://github.com/opentargets/json_schema).

## Installation
```bash
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:
```bash
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:
```bash
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:
* 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)
```bash
# 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
```bash
python -m venv env && source env/bin/activate
pip install -e ".[dev]"
python -m pytest
```

## CI/CD and Releases

This repository uses [GitHub Actions](https://github.com/opentargets/validator/actions) for continuous integration.

Releases are automatically published to [PyPI](https://pypi.org/project/opentargets-validator) 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
