Metadata-Version: 2.4
Name: inspire-schemas
Version: 61.6.35
Summary: Inspire JSON schemas and utilities to use them.
License-Expression: GPL-2.0-only
License-File: LICENSE
Author: CERN
Author-email: admin@inspirehep.net
Requires-Python: >=3.11,<3.15
Classifier: Development Status :: 1 - Planning
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: docs
Provides-Extra: tests
Requires-Dist: bleach (>=6.2,<7)
Requires-Dist: coverage ; extra == "tests"
Requires-Dist: deepdiff ; extra == "tests"
Requires-Dist: idutils (>=1.2.1,<1.6.1)
Requires-Dist: inspire-utils (>=3.0.70,<4)
Requires-Dist: jsonschema (>=4.24,<5)
Requires-Dist: jsonschema2rst (>=0.1.7) ; extra == "docs"
Requires-Dist: pylatexenc
Requires-Dist: pytest (>=8.3,<9) ; extra == "tests"
Requires-Dist: pytest-cov (>=6,<7) ; extra == "tests"
Requires-Dist: pytz
Requires-Dist: pyyaml (>=6,<7)
Requires-Dist: rfc3987
Requires-Dist: scrapy
Requires-Dist: sphinx ; extra == "docs"
Requires-Dist: unidecode (>=1.0.22,<2)
Project-URL: Homepage, https://github.com/inspirehep/inspire-schemas
Project-URL: Issues, https://github.com/inspirehep/inspire-schemas/issues/
Description-Content-Type: text/markdown

<!--
This file is part of INSPIRE-SCHEMAS.
Copyright (C) 2023 CERN.

INSPIRE-SCHEMAS is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

INSPIRE-SCHEMAS is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with INSPIRE-SCHEMAS; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307, USA.

In applying this license, CERN does not
waive the privileges and immunities granted to it by virtue of its status
as an Intergovernmental Organization or submit itself to any jurisdiction.
-->

# inspire-schemas

[![Tests](https://github.com/inspirehep/inspire-schemas/actions/workflows/push-master.yml/badge.svg)](https://github.com/inspirehep/inspire-schemas/actions/workflows/push-master.yml)
[![Coverage](https://img.shields.io/coveralls/inspirehep/inspire-schemas.svg)](https://coveralls.io/r/inspirehep/inspire-schemas)
[![Release](https://img.shields.io/github/tag/inspirehep/inspire-schemas.svg)](https://github.com/inspirehep/inspire-schemas/releases)
[![PyPI downloads](https://img.shields.io/pypi/dm/inspire-schemas.svg)](https://pypi.org/project/inspire-schemas/)
[![License](https://img.shields.io/github/license/inspirehep/inspire-schemas.svg)](LICENSE)

INSPIRE JSON schemas and related tools.

- [Documentation](https://inspire-schemas.readthedocs.io)
- [License](LICENSE)

## Installation

Requires Python 3.11 or newer. Install from PyPI:

```sh
pip install inspire-schemas
```

### Docker

Install Docker, then build the image from the repository root:

```sh
docker build -t inspire-schemas .
```

Start a shell inside the container, then run the tests:

```sh
docker run -it inspire-schemas
pytest tests/
```

The image build already installs dependencies and generates the schema JSON
files, so the container is ready to test as soon as it starts.

## Contributing

Bug fixes, features, and documentation improvements are welcome. Use the
[issue tracker](https://github.com/inspirehep/inspire-schemas/issues) to report
bugs or suggest features. For bugs, include your operating system, relevant
setup details, and steps to reproduce. For features, explain the proposed
behavior and keep the scope focused.

### Development setup

Fork [inspire-schemas](https://github.com/inspirehep/inspire-schemas), then
clone your fork. Install Python 3.11 or newer and Poetry, and run:

```sh
git clone git@github.com:your_name_here/inspire-schemas.git
cd inspire-schemas
poetry install --with test,docs
poetry run python -m scripts.generate_schemas
git checkout -b name-of-your-bugfix-or-feature
```

The `generate_schemas` script resolves the `.yml` schema sources under
`inspire_schemas/records` into the `.json` files the library loads at
runtime; it must be re-run after pulling changes to any schema.

Run the test suite:

```sh
poetry run pytest
```

The test run reports coverage, including missing lines. Code style is checked
separately by pre-commit in CI.

### Pull requests

- Include tests and avoid decreasing test coverage.
- Update documentation and add docstrings for new functionality.
- Ensure GitHub Actions passes on all supported Python versions, starting
  with Python 3.11.


Commit with a sign-off and a descriptive message, push your branch, and open
a pull request on GitHub:

```sh
git add .
git commit -s -m "component: describe your change"
git push origin name-of-your-bugfix-or-feature
```

When applicable, include `Sem-Ver: new feature` or `Sem-Ver: breaks api` in
the commit message body.

