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.1.2.tar.gz (56.0 kB view details)

Uploaded Source

Built Distribution

openqasm_pygments-0.1.2-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file openqasm-pygments-0.1.2.tar.gz.

File metadata

  • Download URL: openqasm-pygments-0.1.2.tar.gz
  • Upload date:
  • Size: 56.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for openqasm-pygments-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9740ce2eb13adbb1de53a1bb447eeaf5cc212aeb4560e4dbed6015c8f50e5bf9
MD5 9e1c60a810624c27872f0c7910b4c4e9
BLAKE2b-256 814cc4722f133b5bbef71bc8043dc1610bb72d1d724630373f046fa477aa9e3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openqasm_pygments-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b224632f8a535ad81609a991ffd82222330a742c6fbd444ed707f8586653ecc0
MD5 eb14919ecd1c526f02a1aa2dd32a5362
BLAKE2b-256 3761a69266cbbddd686229947052d672154589bcd5cc3fee1573be8909c657da

See more details on using hashes here.

Supported by

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