Skip to main content

Python bindings for the IOTA wallet library

Project description

IOTA Wallet Library - Python binding

Python binding to the iota.rs wallet library.

Requirements

Python 3.x & pip

Rust and Cargo, to compile the binding. Install them here.

Installation

  • Go to wallet.rs/bindings/python

Create a virtual environment and use it (optional)

  • python3 -m venv iota_wallet_venv
  • source iota_wallet_venv/bin/activate; Windows: .\iota_wallet_venv\Scripts\activate

Install required dependencies and build the wheel

  • pip install -r requirements-dev.txt
  • pip install .

Run examples

python3 example/[example file]

Example:

  • python3 examples/0-create-account.py

To deactivate the virtual environment (optional)

  • deactivate

Getting Started

After you installed the library, you can create a IotaWallet instance and interact with it.

from iota_wallet import IotaWallet, StrongholdSecretManager

# This example creates a new database and account

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

# Shimmer coin type
coin_type = 4219

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

wallet = IotaWallet('./alice-database', wallet_options, coin_type, 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)

Generate API References

You can generate the python API reference with the following command from this directory:

pydoc-markdown

Customize the Output

Pydoc-markdown automatically loads its configuration from the pydoc-markdown.yml file. You can override it with the CLI, or alter the values.

loaders:
  - type: python
processors:
  - type: filter
    skip_empty_modules: true
  - type: smart
  - type: crossref
renderer:
  type: docusaurus
  docs_base_path: ../../documentation/docs/references/
  relative_output_path: python

  markdown:
    use_fixed_header_levels: true
    header_level_by_type:
      Module: 1
      Class: 2
      Method: 3
      Function: 3
      Data: 3

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

iota_wallet-1.0.0rc2-cp311-none-win_amd64.whl (8.6 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

iota_wallet-1.0.0rc2-cp311-cp311-manylinux_2_35_x86_64.whl (12.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.35+ x86-64

iota_wallet-1.0.0rc2-cp311-cp311-macosx_11_0_arm64.whl (9.2 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

iota_wallet-1.0.0rc2-cp311-cp311-macosx_10_14_x86_64.whl (9.6 MB view hashes)

Uploaded CPython 3.11 macOS 10.14+ x86-64

iota_wallet-1.0.0rc2-cp310-none-win_amd64.whl (8.6 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

iota_wallet-1.0.0rc2-cp310-cp310-manylinux_2_35_x86_64.whl (12.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.35+ x86-64

iota_wallet-1.0.0rc2-cp310-cp310-macosx_11_0_arm64.whl (9.2 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

iota_wallet-1.0.0rc2-cp310-cp310-macosx_10_14_x86_64.whl (9.6 MB view hashes)

Uploaded CPython 3.10 macOS 10.14+ x86-64

iota_wallet-1.0.0rc2-cp39-none-win_amd64.whl (8.6 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

iota_wallet-1.0.0rc2-cp39-cp39-manylinux_2_35_x86_64.whl (12.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.35+ x86-64

iota_wallet-1.0.0rc2-cp39-cp39-manylinux_2_31_x86_64.whl (12.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

iota_wallet-1.0.0rc2-cp39-cp39-macosx_11_0_arm64.whl (9.2 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

iota_wallet-1.0.0rc2-cp39-cp39-macosx_10_14_x86_64.whl (9.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

iota_wallet-1.0.0rc2-cp38-none-win_amd64.whl (8.6 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

iota_wallet-1.0.0rc2-cp38-cp38-manylinux_2_35_x86_64.whl (12.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.35+ x86-64

iota_wallet-1.0.0rc2-cp38-cp38-macosx_11_0_arm64.whl (9.2 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

iota_wallet-1.0.0rc2-cp38-cp38-macosx_10_14_x86_64.whl (9.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

Supported by

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