Pygments tools for OpenQASM
This repository provides the Python package openqasm-pygments, which provides
a lexer for syntax highlighting OpenQASM code with Pygments.
There are current three lexers included, all of which register themselves with
Pygments when this package is installed:
OpenQASM3Lexer(Pygments aliasesopenqasm3andqasm3), for parsing OpenQASM 3 code. Most OpenQASM 2 programs will lex acceptably with this lexer as well, except for some keyword differences.OpenQASM2Lexer(aliasesopenqasm2andqasm2), for lexing OpenQASM 2 programs.OpenPulseLexer(aliasesopenpulse), for lexing the OpenPulse pulse calibration dialect also defined in the OpenQASM 3 specification. For the most part, this lexer will not be used as a root, but theOpenQASM3Lexerwill delegate lexing of calibration blocks to it, when required.
Installation
Install the latest release of openqasm-pygments package from pip:
pip install openqasm-pygments
This will automatically install all the dependencies as well (Pygments, for example) if they are not already installed.
Developing
If you're looking to contribute to this project, please first read our contributing guidelines.
Set up your development environment by installing the development requirements with pip:
pip install -r requirements-dev.txt tox
This installs a few more packages than the dependencies of the package at
runtime, because there are some tools we use for testing also included, such as
tox and pytest.
After the development requirements are installed, you can install an editable version of the package with
pip install -e .
After this, any changes you make to the library code will immediately be present when you open a new Python interpreter session.
License
This project is licensed under version 2.0 of the Apache License. This is a Qiskit project.
Metadata
Release files for openqasm-pygments 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openqasm_pygments-0.2.0.tar.gz | 56.6 kB | With provenance | Details for openqasm_pygments-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openqasm_pygments-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for openqasm_pygments-0.2.0-py3-none-any.whl |
Total release size: 75.3 kB
Release files / openqasm_pygments-0.2.0.tar.gz
| Download URL | openqasm_pygments-0.2.0.tar.gz |
|---|---|
| Size | 56.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9cb60f1f1cb665ceda90f0132316a5c552b92bbdca1c30d8a639a4c0464b5ac
|
|
BLAKE2b-256 checksum How to use checksums |
7e844c3fa01bd772b0b9250d3b4628bd3555487e866a82ce02f210abf98f578c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2025.
Transparency logRelease files / openqasm_pygments-0.2.0-py3-none-any.whl
| Download URL | openqasm_pygments-0.2.0-py3-none-any.whl |
|---|---|
| Size | 18.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6508502d62b0b6157732ebd92d26d8cd1fe091d177213609f5d22e0fbfa3f6f3
|
|
BLAKE2b-256 checksum How to use checksums |
2a92350f5535c67426b54edc20b62c94ba4fa57ea67e4828bb6df39d98c4f172
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2025.
Transparency logSecurity for openqasm-pygments 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for openqasm_pygments-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.