Metadata-Version: 2.4
Name: phir
Version: 0.4.0
Summary: A data model and validation tool for PHIR (PECOS High-level Intermediate Representation).
Author-email: Kartik Singhal <kartik.singhal@quantinuum.com>, Ciarán Ryan-Anderson <ciaran.ryan-anderson@quantinuum.com>
License-Expression: BSD-3-Clause
Project-URL: Changelog, https://github.com/quantinuum/phir/blob/main/CHANGELOG.md
Project-URL: Documentation, https://quantinuum.github.io/phir/
Project-URL: Repository, https://github.com/quantinuum/phir
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic<2.15.0,>=2.14.1
Requires-Dist: rich<15.1,>=14.2
Dynamic: license-file

# PHIR: _[PECOS](https://github.com/PECOS-packages/PECOS) High-level Intermediate Representation_

[![PyPI version](https://badge.fury.io/py/phir.svg)](https://badge.fury.io/py/phir)
[![Python versions](https://img.shields.io/badge/python-3.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-blue.svg)](https://img.shields.io/badge/python-3.12%2C%203.13%2C%203.14%2C%203.15-blue.svg)

`phir` models the [PHIR specification](./spec.md) as a [Pydantic](https://docs.pydantic.dev/latest/) model.
See [our docs](https://quantinuum.github.io/phir/).
Included is the tool `phir-cli` that provides validation and pretty printing on the command line.

## Prerequisites

Python >=3.12

## Installation

Just issue `pip install phir` to obtain the latest stable release.

## phir CLI

The package includes a CLI for directly validating PHIR JSON files using the command line.

```sh
❯ phir-cli -h
usage: phir-cli [-h] [-s] [-v] [jsonfile]

Validates and pretty prints valid PHIR

positional arguments:
  jsonfile       json file to validate against PHIR spec

options:
  -h, --help     show this help message and exit
  -s, --schema   dump JSON schema of the PHIR model and exit
  -v, --version  show program's version number and exit
```

## Development

Clone the repository and run:

```sh
uv sync
uv run pre-commit install
```

See `Makefile` for other useful commands.

## Testing

Issue `make tests` from the root directory.
