Skip to main content

Python compiler for the Neo Virtual Machine

Overview

The neo-boa compiler is a tool for compiling Python files to the .avm format for usage in the Neo Virtual Machine which is used to execute contracts on the Neo Blockchain.

The compiler supports a subset of the Python language ( in the same way that a boa constrictor is a subset of the Python snake species)

What does it currently do

  • Compiles a subset of the Python language to the .avm format for use in the Neo Virtual Machine

  • Works for Python 3.4 and 3.5

What will it do

  • Compile a larger subset of the Python language

  • Support Python 3.6

Get Help or give help

  • Open a new issue if you encounter a problem.

  • Or ping @localhuman on the NEO official community chatroom.

  • Pull requests welcome. New features, writing tests and documentation are all needed.

Installation

Pip

pip install neo-boa

Docker

This project contains a Dockerfile to batch compile Python smart contracts. Clone the repository and navigate into the docker sub directory of the project. Run the following command to build the container:

docker build -t neo-boa .

The neo-boa Docker container takes a directory on the host containing python smart contracts as an input and a directory to compile the .avm files to as an output. It can be executed like this:

docker run -it -v /absolute/path/input_dir:/python-contracts -v /absolute/path/output_dir:/compiled-contracts neo-boa

The -v (volume) command maps the directories on the host to the directories within the container.

Manual

Clone the repository and navigate into the project directory. Make a Python 3 virtual environment and activate it via:

python3 -m venv venv
source venv/bin/activate

or, to install Python 3.5 specifically:

virtualenv -p /usr/local/bin/python3.5 venv
source venv/bin/activate

Then, install the requirements:

pip install -r requirements.txt

Usage

The compiler may be used like in the following example:

from boa.compiler import Compiler

Compiler.load_and_save('path/to/your/file.py')

Docs

You can read the docs here.

Tests

Tests are important.

License

Donations

Accepted at ATEMNPSjRVvsXmaJW4ZYJBSVuJ6uR2mjQU

Metadata

Release files for neo-boa 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neo-boa 0.2.2
File Size Uploaded Provenance Actions
neo-boa-0.2.2.tar.gz 57.8 kB Without provenance Details for neo-boa-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for neo-boa 0.2.2
File Interpreter ABI Platform Actions
neo_boa-0.2.2-py3-none-any.whl Python 3 none any Details for neo_boa-0.2.2-py3-none-any.whl

Total release size: 147.6 kB

Release files / neo-boa-0.2.2.tar.gz

Download URL neo-boa-0.2.2.tar.gz
Size 57.8 kB
Tags Source
SHA-256 checksum
How to use checksums
db26b88ba59c8820d28fdee0a147a18d59614f03cb685d702b673cd57ec4d3f3
BLAKE2b-256 checksum
How to use checksums
0f8c5636bccc9fb074e5781d258c3e39cb68c35c8dbf708c358e73aabc67704b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / neo_boa-0.2.2-py3-none-any.whl

Download URL neo_boa-0.2.2-py3-none-any.whl
Size 89.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ef04d7c8dda4096bf50f1eee60e8487e7f8977e65d55988098f7158bd47a219
BLAKE2b-256 checksum
How to use checksums
25d3ddc5e3be1be96bcaf0f8c248efad1154eadcbf365bd6a264ee27bc7d5bfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for neo-boa 0.2.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

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