Skip to main content

===========================================
Python compiler for the kaze Virtual Machine
===========================================

Overview
--------

The ``kaze-boa`` compiler is a tool for compiling Python files to the
``.avm`` format for usage in the `kaze Virtual
Machine <https://github.com/kaze-project/kaze-vm/>`__ which is used to
execute contracts on the `kaze
Blockchain <https://github.com/kaze-project/kaze/>`__.

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 <https://github.com/kaze-project/kaze-vm>`__
- 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 <https://github.com/KAZEBLOCKCHAIN/kaze-boa/issues/new>`__ if you
encounter a problem.
- Or ping **@localhuman** on the `kaze official community
chatroom <https://discord.gg/R8v48YA>`__.
- Pull requests welcome. New features, writing tests and documentation
are all needed.

Installation
------------

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

Pip
^^^

::

pip install kaze-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 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.

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

::

virtualenv -p /usr/local/bin/python3.6 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 <http://kaze-boa.readthedocs.io/en/latest/>`__.

Tests
-----

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

License
-------

- Open-source `MIT <LICENSE.md>`__.
- Main author is `localhuman <https://github.com/localhuman>`__.

Donations
---------

Accepted at **ATEMNPSjRVvsXmaJW4ZYJBSVuJ6uR2mjQU**


Metadata

Release files for kaze-boa 0.5.1

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

Source distribution (sdist)

Source distribution for kaze-boa 0.5.1
File Size Uploaded Provenance Actions
kaze-boa-0.5.1.tar.gz 36.1 kB Without provenance Details for kaze-boa-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kaze-boa 0.5.1
File Interpreter ABI Platform Actions
kaze_boa-0.5.1-py3-none-any.whl Python 3 none any Details for kaze_boa-0.5.1-py3-none-any.whl

Total release size: 95.4 kB

Release files / kaze-boa-0.5.1.tar.gz

Download URL kaze-boa-0.5.1.tar.gz
Size 36.1 kB
Tags Source
SHA-256 checksum
How to use checksums
97dce455508240e4e21b8fd40c4cc17f2c5bea2ffd964547ec9ae4317b5ffe6f
BLAKE2b-256 checksum
How to use checksums
c34662adc94e81115986d18b1a02eda708e2ef07da2ce9a9c6818791308bbbcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

Release files / kaze_boa-0.5.1-py3-none-any.whl

Download URL kaze_boa-0.5.1-py3-none-any.whl
Size 59.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1743ef11c967013125d91f71013c918d0b360150771f724872ee0c3eb35973f3
BLAKE2b-256 checksum
How to use checksums
a2d7cbb486d184bd2b25c653879ef1420a73da0e920e1ebe01eb2fe43cc5b1ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

Security for kaze-boa 0.5.1

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