Skip to main content

A Python compiler for the kaze Virtual Machine

Project description

Python compiler for the kaze Virtual Machine


The ``kaze-boa`` compiler is a tool for compiling Python files to the
``.avm`` format for usage in the `kaze Virtual
Machine <>`__ which is used to
execute contracts on the `kaze
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 `kaze Virtual
Machine <>`__
- Works for Python 3.6+
- Adds debugging map for debugging in kaze-python or other kaze debuggers

What will it do

- Compile a larger subset of the Python language

Get Help or give help

- Open a new
`issue <>`__ if you
encounter a problem.
- Or ping **@localhuman** on the `kaze official community
chatroom <>`__.
- Pull requests welcome. New features, writing tests and documentation
are all needed.


Make sure you are using a Python 3.6 or greater virtual environment



pip install kaze-boa


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


docker build -t kaze-boa .

The kaze-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 kaze-boa

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


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.6 specifically:


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

Then, install the requirements:


pip install -r requirements.txt


The compiler may be used like in the following example:


from boa.compiler import Compiler



You can `read the docs
here <>`__.


All tests are located in ``boa_test/test``. Tests can be run with the following command ``python -m unittest discover boa_test``


- Open-source `MIT <>`__.
- Main author is `localhuman <>`__.


Accepted at **ATEMNPSjRVvsXmaJW4ZYJBSVuJ6uR2mjQU**

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

kaze-boa-0.5.1.tar.gz (36.1 kB view hashes)

Uploaded source

Built Distribution

kaze_boa-0.5.1-py3-none-any.whl (59.3 kB view hashes)

Uploaded py3

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