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.0rc1-cp311-none-win_amd64.whl (10.2 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.14+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.14+ x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.35+ x86-64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.14+ x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8manylinux: glibc 2.35+ x86-64

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

Uploaded CPython 3.8macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: iota_sdk-1.0.0rc1-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 10.2 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.0rc1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 c57efcd0a49f85af08cbe94a1eaa5512fa96ac22f98d585abaa392218fb12e21
MD5 79d7dddad58421b7e226c87d5a71a7f9
BLAKE2b-256 93ed051c86c4410ae4303c574e9974d5876b1d6b8870af467381a18d9af014fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 faa787683eeb58d236b830fc20e52744ef73cf2528a61ea7f6572c67314c1658
MD5 913976fffadbd87071aac80aa95cece5
BLAKE2b-256 e8f54e1b79ad6af30ca7cfc376cb86f25686ac7a64524850bdcb4128bc4dee40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fbb65ff0171200bd6bdf1fe8daa457880dec57f9c965b605e822bed37d27b41a
MD5 948cc424bdddf86ace85023e4a957f3f
BLAKE2b-256 7407d111a166ada4bbfd618bb12577fd5c1c9872d475293f065eaf90bdfc9696

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5c541c032381f88f365685a5c5c527933bb91eb8bab8422d64482c90f8849597
MD5 c1d78b86958a4a3cf85ab7c2639aa167
BLAKE2b-256 99d3ebef84287ef01f3ae0996502b4492425a0d88f24d8b3ba33d7a3d0f1883e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iota_sdk-1.0.0rc1-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 10.2 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.0rc1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 f769486ac5930c4038a42b3be1c7d92b8f6dc81721830f518982f4269d0a85ef
MD5 a5d2ed086e9d12290331da6aeda97c71
BLAKE2b-256 7d25580fe27cc9b9a3e515262a0fed33b0a582f94d9edb098c69a24b81e7331e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 1782923f6a5bcd1a356ce64c496dec3440b98233a08a3e64ac7e4d9f23456da7
MD5 912d27a0679ae152a609d6199d0bd668
BLAKE2b-256 11c6e8fde01abed0edee81ea7a9edbdea7a20e09a7694c230409dfaf924708ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4644b452ab18c7fd755e6cd1f110522e6e13510a32d2fc990352c12d02135eaa
MD5 67148d84ebf14c39ebd6f67028d7fc31
BLAKE2b-256 802b478d5ac82504036984fcd39662f6ab3403d69a07037a43953cfb73d202f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 013f83dff5a2444aa7136c6b08196926a0dab256d1c11ce95351f579d2411746
MD5 869ccf5270986275281876d33dcad746
BLAKE2b-256 82671ee6582096fd9d4dcaccb229a27032195e4af26bcf66960e149fdda48505

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iota_sdk-1.0.0rc1-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 10.2 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.0rc1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 62b77d09a113954375c7cf5e39235c9759c74e4e414ff8f7e9d22e3986a50dbd
MD5 fc098041ee98dd38fd39b3caa1ea2a43
BLAKE2b-256 7b0a10ef5bf0a5fe3fc27e8fcfc6d2161cfa8a5de59db93f3a3bd6cbebfdfde9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp39-cp39-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 57dc7bacef4d0a3f4d3d01323a14cbc4c2f30eaab55305da03e1869f8a4ca872
MD5 7779b051a2e1cd505db3b5aa49e922a7
BLAKE2b-256 525e7a77cc107815937e46d7bed096ee9f0488b7626652ac2847f3dc6f4ac5c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d1b2ef41c2ac0ebbd131dfcbc75e408b9e0ab95277be7a9f0640679e9c69e69b
MD5 e1984bc7ebdd55576cd8cc4865d95432
BLAKE2b-256 16be99a9e9e1924c9a5653317aa424b5d62110accdb7f1dbfd24ee4e523219b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8b98ee515447109af8ca891491324211f3db8f601e5b7b0288b390dda2898bd9
MD5 5d2c4b37ed837da3323c715e309bac56
BLAKE2b-256 adcc66bf4d7ad993bf4d31a66dab4f472a84e0cd462c5a63028aa6e58a964ad6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iota_sdk-1.0.0rc1-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 10.2 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.0rc1-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 7f76a985b616fd638d6451c08e8c5c57f45348d6f19029103904981c562e1755
MD5 dae23295db3ac979a6b5b676055872eb
BLAKE2b-256 a160508b043292cd6367e5c07c93d7ba60abbde795f7bd93b231006cc6c5dd47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp38-cp38-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 2e9627d896c69fbda842880609ce85d5cd16f2455af64b981ad9d4bdca75200d
MD5 122e864a45440045e7b07b87ffc111cd
BLAKE2b-256 ac7f0d8801e2c9698f97407bcad2759e0ab74ef24f986a99e7948b67f13fe378

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0ba2a6e42a56939fb1d0cf2d97e654c6f45379bb8c219c431d1d6ad5c01b1d1
MD5 44619ed432b37c7c61a5ba3a592aad6a
BLAKE2b-256 9d195075f0042af6b9a6911c5f10a805767d3ca51c85995facfcc74aa4739aa8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iota_sdk-1.0.0rc1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 1f0b69833af14ddc0e984de26a02fb360ccb764a82d0fc7dbb37bacbfaa84f38
MD5 9b836daa1fd340e85320c1129e7e89ce
BLAKE2b-256 81f49b57557e891cd97b84a9424efda8ab0a4046f93e3ec2beedd57aeaefd2bc

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