Skip to main content

Python bindings for the IOTA SDK library

Project description

IOTA SDK Library - Python binding

Python binding to the iota-sdk library.

Table of contents

Requirements

Getting Started

Install the IOTA SDK

  1. Move to the Python bindings directory:

    cd iota-sdk/bindings/python
    
  2. (optional) Create a virtual environment and use it. On Linux and macOS, you can run the following commands:

    '''bash python3 -m venv iota_sdk_venv source iota_sdk_venv/bin/activate '''

    If you are using Windows, you should run the following instead:

    .\iota_sdk_venv\Scripts\activate`
    
  3. Install the required dependencies and build the wheel by running the following commands:

    pip install -r requirements-dev.txt
    pip install .
    
  4. (optional) If you want to deactivate the virtual environment, run the following command:

    deactivate
    

Client Usage

The following example creates a Client instance connected to the Shimmer Testnet, and retrieves the node's information by calling Client.get_info(), and then print the node's information.

from iota_sdk import Client

# Create a Client instance
client = Client(nodes=['https://api.testnet.shimmer.network'])

# Get the node info
node_info = client.get_info()
print(f'{node_info}')

Wallet Usage

The following example will create a new Wallet Account that connects to the Shimmer Testnet using the StrongholdSecretManager to safely store a seed derived from a mnemonic, and then print the account's information.

from iota_sdk import Wallet, StrongholdSecretManager, CoinType

# This example creates a new database and account

wallet_options = {
    'nodes': ['https://api.testnet.shimmer.network'],
}

secret_manager = StrongholdSecretManager("wallet.stronghold", "some_hopefully_secure_password")

wallet = Wallet('./alice-walletdb', wallet_options, coin_type=CoinType.SHIMMER, secret_manager)

# Store the mnemonic in the Stronghold snapshot. This only needs to be done once
account = wallet.store_mnemonic("flame fever pig forward exact dash body idea link scrub tennis minute " +
          "surge unaware prosper over waste kitten ceiling human knife arch situate civil")

account = wallet.create_account('Alice')
print(account.get_metadata())

Examples

You can use the provided code examples to 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 find the API reference for the Python bindings in the IOTA Wiki.

Learn More

To learn more about Rust, see the Rust documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

iota_sdk-1.0.0-cp311-none-win_amd64.whl (8.3 MB view details)

Uploaded CPython 3.11Windows x86-64

iota_sdk-1.0.0-cp311-cp311-manylinux_2_35_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

iota_sdk-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

iota_sdk-1.0.0-cp311-cp311-macosx_10_14_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

iota_sdk-1.0.0-cp310-none-win_amd64.whl (8.3 MB view details)

Uploaded CPython 3.10Windows x86-64

iota_sdk-1.0.0-cp310-cp310-manylinux_2_35_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

iota_sdk-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

iota_sdk-1.0.0-cp310-cp310-macosx_10_14_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

iota_sdk-1.0.0-cp39-none-win_amd64.whl (8.3 MB view details)

Uploaded CPython 3.9Windows x86-64

iota_sdk-1.0.0-cp39-cp39-manylinux_2_35_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.35+ x86-64

iota_sdk-1.0.0-cp39-cp39-macosx_11_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

iota_sdk-1.0.0-cp39-cp39-macosx_10_14_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

iota_sdk-1.0.0-cp38-none-win_amd64.whl (8.3 MB view details)

Uploaded CPython 3.8Windows x86-64

iota_sdk-1.0.0-cp38-cp38-manylinux_2_35_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.35+ x86-64

iota_sdk-1.0.0-cp38-cp38-macosx_11_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

iota_sdk-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

File details

Details for the file iota_sdk-1.0.0-cp311-none-win_amd64.whl.

File metadata

  • Download URL: iota_sdk-1.0.0-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 8.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for iota_sdk-1.0.0-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 3fd7857231a88e620065b11c9f99d98c6e89baea24bee74419b82e92e566940e
MD5 063fd477af94e1c6508bd6d42c09d513
BLAKE2b-256 388d0721f4c43fc56d6256fcb534c34c26d36aa031e88f0a2d121a5b8fa57d2b

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 d692960fed9e1743f443d6323eedbe7ebb6b411cbb170a30aeaf80127f353ed1
MD5 ab703571b4c5bea873a526c3f2ab1ba7
BLAKE2b-256 66450e2e12ff23d5c0403fb4800fd4b68a42dd5b459d49551a252496a8017b28

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1745c5b87c55ae412ec4f6ff2014b8a6dceb66bc337d433a4e8df032ad6b8b10
MD5 92e9457e0c885d6b953dff5d0e82c467
BLAKE2b-256 f133dd1940ae73aef61621444a39d17fb5a82b4f4cabb9fc9a0a74d4efd55146

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7c5e70185e107acd78af0565dc1f13bb407690567cd122c96337714370354563
MD5 f9e85737e6295a95ff5af16626db2b93
BLAKE2b-256 cd0a3f0bb9db96d480401f1c37fd7aafb7d77c1fb29ebc23307ee9140f508ff2

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp310-none-win_amd64.whl.

File metadata

  • Download URL: iota_sdk-1.0.0-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 8.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for iota_sdk-1.0.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 f7fd27f1227cd0db506caf909e1832ef46ed4f935087beaaa055cf8b4d22a09c
MD5 385b09efe10d97e0738f1c49a5c705a0
BLAKE2b-256 56521602eadf94c444d5b6877bda252d416375e71a98ae7ab72ef91b847e5c7c

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 73ade489c8bf1ff5b28a8c184058a481e7947b3fa5cba6c7b79b108c2dee620a
MD5 7f0c24466f09ba4a83db6fa1756b9a18
BLAKE2b-256 3e604874061aec0a6849ef4100b7b03b999d8348112463172761b0d4cd394a0f

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 015fed39c937d14a3178edb800b136f797bdffcb8baa9936adc5e5ba7428a503
MD5 0703d18277937ade1d6f35d4d64f0efb
BLAKE2b-256 4396616b793e26db76eac21180a10d6d93dd83a28adeb7400c6d4ea647bcfb64

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d662507e0c8d29c9dc6d2d7c6d4a22e31eb76484a6489697495495d3002ca2ad
MD5 9ef18c20f1fd1d6f4290453af2fc54fb
BLAKE2b-256 cd7bb3a37417c493d6b31f2dcf889ed09d795b063529779cc8e08e5109fcc3fb

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp39-none-win_amd64.whl.

File metadata

  • Download URL: iota_sdk-1.0.0-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 8.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for iota_sdk-1.0.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 72dceff4add84425effe76859b673e6afc0e000ce73888290205e9e165250f17
MD5 2697b04ec2f5a526ed4daeed1a7e9806
BLAKE2b-256 0904175e349d16bf18cdb2a22e371fd027b1b7ff2a9b710f6771c4818a8c116b

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp39-cp39-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp39-cp39-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f9a93d889ce6608af9479a6efb5ca977a965e10c0874ceae8d812d81c614afec
MD5 6721fdbda798daedb295e67a5aab9daf
BLAKE2b-256 1d1dee5b31fdb39670094d5ba687eb1b5247cb42075a1032877d0f9a589f8aa9

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 892fe163409e32802ce4cbabcf8d6aa2d4d895ecce6cc71c747e157d27fd3663
MD5 692b76d3e51ed451dd9851ba6b39a8ce
BLAKE2b-256 ab7f1c112262b16ce8fa8e69733cdf0b15c5b909f9f42b1876b057b677820ad9

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 928de8c4c84154f26b80ff8618a85ecf0ee75fe3b05ec1ced52c4e61bee28a6f
MD5 24c6fe03d25892ecbb59e17d2dd7dec0
BLAKE2b-256 cd88d6d1e134f1327cb88a71fb505a6f613fd893d0afbc535ea9001cfcfa941d

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp38-none-win_amd64.whl.

File metadata

  • Download URL: iota_sdk-1.0.0-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 8.3 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for iota_sdk-1.0.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 5f23e672ac3ae96988d7b8cb8bb6a7cf2c85a8ef240fefb245ae1e69d66bb1ec
MD5 708fb9f428c52cefdf5203a81942e186
BLAKE2b-256 f1c02ef759d12f8944441d110c9a13c33029f39aeafd393c526c084a34faa0fb

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp38-cp38-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp38-cp38-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 27e8d7d07b281263271a5c0243039a7ad2ab72a41ab07834534d2cec5cfa61ca
MD5 950e5dbb5b3d6e70ea6ec20344104a99
BLAKE2b-256 deb4c4fd14839aba74313698f8105f0ccd9d5b6268f901fc25d8c5e29e7e0a7a

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e726b9b59107aa47f62ea43aa9ad9c64ccf9ac9304957a5c51321a0f31a71f4e
MD5 e30a2de185c2bdb8c2a763faa256c318
BLAKE2b-256 b64e54d8ff1d588424c6841c67b3569c3cebcb36a58f589e4cf625c2131acc91

See more details on using hashes here.

File details

Details for the file iota_sdk-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for iota_sdk-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 05c74fff438b72113a8a16286ba284c13603c0845976d99b0f8844c55cc5aaff
MD5 4b24f73f552673755ca7afe0fcbeb2e5
BLAKE2b-256 04697bda8133170bf31eafb8c5c6cd9257bc8bfc6bbaded40952f9e8f4784a7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page