Skip to main content

Python wrapper and version manager for the Huff compiler

Project description

py-huffc

Python wrapper and version manager for the Huff compiler

Dependencies

To build binaries from source when a pre-built binary isn't available, the build tool cargo must be installed. Refer to the cargo documentation for instruction on installing it.

To prevent rate limits when querying the GitHub API, it is recommended to include a GitHub personal access token as an environment variable. Refer to the GitHub API documentation for information on generating a personal access token.

export GITHUB_TOKEN="github_pat_XXXX"

Installation

$ pip install py-huffc

Usage

>>> import huffc
>>> with huffc.VersionManager() as hvm:
...     hvm.fetch_remote_versions()  # list versions available to install
...
[Version('0.3.1')]
>>> with huffc.VersionManager() as hvm:
...     hvm.install("0.3.1", silent=True)  # install a version
...
>>> huffc.VersionManager.fetch_local_versions()  # list locally installed versions
[Version('0.3.1')]
>>> huffc.VersionManager.get_executable("0.3.1")  # get the path for an installed binary
PosixPath('/home/user/.huffc/huffc-0.3.1')
>>> huffc.compile(["../huff-rs/huff-examples/erc20/contracts/ERC20.huff"], version="0.3.1")  # compile a list of contracts
{"../huff-rs/huff-examples/erc20/contracts/ERC20.huff": {...}}
>>> huffc.VersionManager.uninstall("0.3.1")  # uninstall a version

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

py-huffc-0.1.1.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

py_huffc-0.1.1-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

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