Skip to main content

Pygments tools for OpenQASM

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openqasm_pygments-0.2.0.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openqasm_pygments-0.2.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file openqasm_pygments-0.2.0.tar.gz.

File metadata

  • Download URL: openqasm_pygments-0.2.0.tar.gz
  • Upload date:
  • Size: 56.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for openqasm_pygments-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e9cb60f1f1cb665ceda90f0132316a5c552b92bbdca1c30d8a639a4c0464b5ac
MD5 7453dc3a0342e9c646f71fdcff370a47
BLAKE2b-256 7e844c3fa01bd772b0b9250d3b4628bd3555487e866a82ce02f210abf98f578c

See more details on using hashes here.

Provenance

The following attestation bundles were made for openqasm_pygments-0.2.0.tar.gz:

Publisher: release.yml on openqasm/openqasm-pygments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openqasm_pygments-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openqasm_pygments-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6508502d62b0b6157732ebd92d26d8cd1fe091d177213609f5d22e0fbfa3f6f3
MD5 8a28e4f2f74f4547cd3086903e34d903
BLAKE2b-256 2a92350f5535c67426b54edc20b62c94ba4fa57ea67e4828bb6df39d98c4f172

See more details on using hashes here.

Provenance

The following attestation bundles were made for openqasm_pygments-0.2.0-py3-none-any.whl:

Publisher: release.yml on openqasm/openqasm-pygments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page