Getting Started with Python
In a production setup, do not store passwords in the host's environment variables or in the source code. See our backup and security recommendations for production setups.
Requirements
- Python 3.10+
- pip ^21.x
Rust
andCargo
to compile the binding. Install them here.
Install the IOTA SDK
Install Using a Pip
To start using the IOTA SDK in your Python project, you can use pip to install:
pip install iota-sdk
Build the Binding from Source
- Move to the Python bindings directory:
cd iota-sdk/bindings/python
- (optional) You can run the following commands create a virtual environment and use it:
- Linux
- macOS
- Windows
python3 -m venv iota_sdk_venv
source iota_sdk_venv/bin/activate
python3 -m venv iota_sdk_venv
source iota_sdk_venv/bin/activate
.\iota_sdk_venv\Scripts\activate
- Install the required dependencies and build the wheel by running the following commands:
pip install -r requirements-dev.txt
pip install .
- (optional) If you want to deactivate the virtual environment, run the following command:
deactivate
Usage
Client
After you installed the library, you can create a Client
instance and interface with it.
loading...
Wallet
After you installed the library, you can create a Wallet
instance and interact with it.
loading...
What's next?
How-To Guides
Once you have installed the IOTA SDK, you can start building your application. You can find usage examples in this Wiki's how-to guides.
More Examples
You can use the provided code examples to get acquainted with the IOTA SDK. You can use the following command to run any example:
python3 example/[example file]
- Where
[example file]
is the file name from the example folder. For example:
python3 examples/client/00_get_info.py
API Reference
You can generate the Python API reference with the following command from this directory:
pip install pydoc-markdown && pydoc-markdown
API Reference
The IOTA SDK Rust API Reference is in the crate documentation.