Getting Started with IOTA Client Python Binding
It is not recommended to store passwords or seeds on a host's environment variables or in the source code in a production setup. Please follow our backup and security recommendations for production use.
Install prebuild libraries
Easiest way how to get python binding up and running is to leverage pre-built python libraries for linux/macos/windows that can be installed to your python environment (3.6+) via
pip. The binding is automagically generated using github actions.
The latest artifacts for major python versions can be also grabbed using nighly.link service. Download zip file for the given os and pyversion, unpack wheel file (
.whl) and install it via
pip install <wheel_file>
Install from source
- Rust and Cargo.
- (for Linux only)
libudev. You can install it with
apt install libudev-dev.
Clone the Repository
You can clone the iota.rs client library by running the following command:
git clone -b production https://github.com/iotaledger/iota.rs
Change to the Python Binding Directory
After you have cloned the repository, you should change directory to iota.rs/bindings/python/native. You can do so by running the following command:
Install the Required Dependencies and Build the Wheel
Install and run maturin:
pip3 install maturin
maturin build --manylinux off
The wheel file is now created in
bindings/python/native/target/wheels. You can install it with:
pip3 install [THE_BUILT_WHEEL_FILE]
Once it has been properly installed you can double check it using
You should see the similar output:
Once installed in the given python environment you are all set and can start hacking using python binding!
client = iota_client.Client(nodes_name_password=[['https://api.lb-0.h.chrysalis-devnet.iota.cafe']])