opentargets-validator


Nameopentargets-validator JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/opentargets/validator
SummarySchema validation for evidence submitted to Open Targets
upload_time2023-09-18 09:52:22
maintainer
docs_urlNone
authorOpen Targets
requires_python>=3.8
licenseApache License, Version 2.0
keywords opentargets bioinformatics python3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/opentargets-validator.svg)](https://badge.fury.io/py/opentargets-validator)
[![Build Status](https://travis-ci.org/opentargets/validator.svg?branch=master)](https://travis-ci.org/opentargets/validator)
[![codecov](https://codecov.io/gh/opentargets/validator/branch/master/graph/badge.svg)](https://codecov.io/gh/opentargets/validator)

# 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://docs.targetvalidation.org/data-sources/data-sources) against the Open Targets [JSON schemas](https://github.com/opentargets/json_schema).

## Installation
```bash
pip install --upgrade opentargets-validator
```

## 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 instructions
An editable copy can be installed within a virtual environment:
```bash
python -m venv env
source env/bin/activate
pip install -e .[dev]
```

The tests can be run with:
```sh
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](https://travis-ci.com/opentargets/validator) and [CodeCov integration](https://codecov.io/gh/opentargets/validator).

Releases are put on [PyPI](https://pypi.org/project/opentargets-validator) automatically via Travis from GitHub tags.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/opentargets/validator",
    "name": "opentargets-validator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "opentargets,bioinformatics,python3",
    "author": "Open Targets",
    "author_email": "data@opentargets.org",
    "download_url": "https://files.pythonhosted.org/packages/69/d1/9fb4452139200e3b17286ca1c5c3eaaba4c2b98a836321d85f690a49bb57/opentargets-validator-1.0.0.tar.gz",
    "platform": "any",
    "description": "[![PyPI version](https://badge.fury.io/py/opentargets-validator.svg)](https://badge.fury.io/py/opentargets-validator)\n[![Build Status](https://travis-ci.org/opentargets/validator.svg?branch=master)](https://travis-ci.org/opentargets/validator)\n[![codecov](https://codecov.io/gh/opentargets/validator/branch/master/graph/badge.svg)](https://codecov.io/gh/opentargets/validator)\n\n# Open Targets JSON validator\nThe `opentargets-validator` tool in this repository validates JSON files which are submitted to Open Targets by various [data sources](https://docs.targetvalidation.org/data-sources/data-sources) against the Open Targets [JSON schemas](https://github.com/opentargets/json_schema).\n\n## Installation\n```bash\npip install --upgrade opentargets-validator\n```\n\n## Usage examples\nValidating a local gzipped file against the latest schema version from GitHub:\n```bash\nopentargets_validator \\\n  --schema https://raw.githubusercontent.com/opentargets/json_schema/master/schemas/disease_target_evidence.json \\\n  evidence.json.gz\n```\n\nValidating a portion of the local file against a local copy of the schema:\n```bash\nzcat evidence.json.gz | head -n 100 | opentargets_validator --schema evidence_schema.json\n```\n\n## Input files\nThe validator has to be provided with two inputs:\n1. Data to validate. It has to contain exactly one complete JSON object per line.\n2. Schema to validate against. It can be any valid JSON Draft 7 schema.\n\nEither of the input files (data and schema) can be read from:\n* STDIN (`-`)\n* Uncompressed remote file (https://example.com/example.json)\n* Uncompressed local file (`example.json`)\n* GZIP-compressed local file (`example.json.gz`)\n\n## Development instructions\nAn editable copy can be installed within a virtual environment:\n```bash\npython -m venv env\nsource env/bin/activate\npip install -e .[dev]\n```\n\nThe tests can be run with:\n```sh\npython -m pytest --cov=opentargets_validator --cov-report term tests/ --fulltrace\n```\nNote 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.\n\nThis repository has [Travis integration](https://travis-ci.com/opentargets/validator) and [CodeCov integration](https://codecov.io/gh/opentargets/validator).\n\nReleases are put on [PyPI](https://pypi.org/project/opentargets-validator) automatically via Travis from GitHub tags.\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "Schema validation for evidence submitted to Open Targets",
    "version": "1.0.0",
    "project_urls": {
        "Download": "https://github.com/opentargets/validator/archive/1.0.0.tar.gz",
        "Homepage": "https://github.com/opentargets/validator"
    },
    "split_keywords": [
        "opentargets",
        "bioinformatics",
        "python3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "83ddd3452d4ec60568f319b2c724fb23bbdd67e0dcd6d2d5077861679a2d9d10",
                "md5": "704165fc27a8c4e334b49d0f763f0dc9",
                "sha256": "932dc2f4de60858cc2183f67c8548c250e87d3df2800b93cfd702afd3576cca5"
            },
            "downloads": -1,
            "filename": "opentargets_validator-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "704165fc27a8c4e334b49d0f763f0dc9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10856,
            "upload_time": "2023-09-18T09:52:21",
            "upload_time_iso_8601": "2023-09-18T09:52:21.511596Z",
            "url": "https://files.pythonhosted.org/packages/83/dd/d3452d4ec60568f319b2c724fb23bbdd67e0dcd6d2d5077861679a2d9d10/opentargets_validator-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69d19fb4452139200e3b17286ca1c5c3eaaba4c2b98a836321d85f690a49bb57",
                "md5": "e4ec677ead324a78ae9b00c49d573904",
                "sha256": "7908b649a82f7d45d2e1e4a32b35e4ae1ffbdd32cb3060e38d2155af45da717f"
            },
            "downloads": -1,
            "filename": "opentargets-validator-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e4ec677ead324a78ae9b00c49d573904",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10183,
            "upload_time": "2023-09-18T09:52:22",
            "upload_time_iso_8601": "2023-09-18T09:52:22.680668Z",
            "url": "https://files.pythonhosted.org/packages/69/d1/9fb4452139200e3b17286ca1c5c3eaaba4c2b98a836321d85f690a49bb57/opentargets-validator-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-18 09:52:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "opentargets",
    "github_project": "validator",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "opentargets-validator"
}
        
Elapsed time: 0.11324s