Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cqcl/phir
PHIR (PECOS High-level Intermediate Representation) Spec and data model
https://github.com/cqcl/phir
json-schema python quantinuum quantum-computing
Last synced: 14 days ago
JSON representation
PHIR (PECOS High-level Intermediate Representation) Spec and data model
- Host: GitHub
- URL: https://github.com/cqcl/phir
- Owner: CQCL
- License: bsd-3-clause
- Created: 2023-09-22T08:22:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-21T21:25:52.000Z (15 days ago)
- Last Synced: 2024-10-22T00:52:50.885Z (15 days ago)
- Topics: json-schema, python, quantinuum, quantum-computing
- Language: Python
- Homepage: https://cqcl.github.io/phir/
- Size: 1.58 MB
- Stars: 2
- Watchers: 10
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://img.shields.io/badge/python-3.10%2C%203.11%2C%203.12-blue.svg)`phir` models the [PHIR specification](./spec.md) as a [Pydantic](https://docs.pydantic.dev/latest/) model.
See [our docs](https://cqcl.github.io/phir/).
Included is the tool `phir-cli` that provides validation and pretty printing on the command line.## Prerequisites
Python >=3.10
## 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 specoptions:
-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
python -m venv .venv
source .venv/bin/activate
pip install -U pip setuptools
pip install -r requirements.txt
pre-commit install
```Then, install the project using:
```sh
pip install -e .
```See `Makefile` for other useful commands.
## Testing
Issue `pytest` from the root directory.