A Python compiler for the Neo Virtual Machine on the Ontology 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.6+
- Adds debugging map for debugging in neo-python or other NEO debuggers
What will it do
- Compile a larger subset of the Python language
Make sure you are using a Python 3.6 or greater virtual environment
pip install neo-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 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.
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 Compiler.load_and_save('path/to/your/file.py')
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
Accepted at ATEMNPSjRVvsXmaJW4ZYJBSVuJ6uR2mjQU
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size ont_boa-0.4.9-py3-none-any.whl (116.9 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size ont-boa-0.4.9.tar.gz (65.2 kB)||File type Source||Python version None||Upload date||Hashes View|