Skip to main content

Pygments tools for OpenQASM

LicenseReleaseDownloads

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 aliases openqasm3 and qasm3), for parsing OpenQASM 3 code. Most OpenQASM 2 programs will lex acceptably with this lexer as well, except for some keyword differences.
  • OpenQASM2Lexer (aliases openqasm2 and qasm2), for lexing OpenQASM 2 programs.
  • OpenPulseLexer (aliases openpulse), 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 the OpenQASM3Lexer will 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.

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)

Source distribution for openqasm-pygments 0.2.0
File Size Uploaded
openqasm_pygments-0.2.0.tar.gz 56.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openqasm-pygments 0.2.0
File Interpreter ABI Platform
openqasm_pygments-0.2.0-py3-none-any.whl Python 3 none any Details

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 log

Release 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 log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page