Skip to main content

Abstractions for the Polkadot ecosystem

Project description

PyPolkadot

Abstractions for the Polkadot ecosystem.

This package is a very opinionated wrapper around py-substrate-interface. It provides a simple synchronous interface for interacting with the Polkadot ecosystem. The PyPolkadot package can automatically detect when the metadata is outdated and refresh it behind the scenes. This ensures that developers don’t have to manually handle metadata updates.

Note: Light client functionality is not yet supported.

Installation

pip install PyPolkadot

Usage

Basic usage

from polkadot import *

# Initialize Polkadot instance
polka = Polkadot()  # Defaults to the mainnet relay chain

# Optionally, specify a custom RPC endpoint or use a testnet
polka = Polkadot(endpoint="wss://polkadot-rpc-tn.dwellir.com")

# Get account balance
balance = polka.get_balance("12pDATAH2rCakrYjo6UoYFtmTEUpSyePTum8U5x9QdySZuqn")
print(f"Balance: {balance} DOT")

Project details


Download files

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

Source Distribution

pypolkadot-0.1.1.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

PyPolkadot-0.1.1-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file pypolkadot-0.1.1.tar.gz.

File metadata

  • Download URL: pypolkadot-0.1.1.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pypolkadot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 09677ef95e55aad534d1dc22b90cd3b8faf3d632d18a533cc4a4e29323c999c6
MD5 0567b389c1e4113325ee8decccf847fd
BLAKE2b-256 9ef744013d86a4eab8b0d4d1c6c085c81ba8380708a0f7332ec5f31f3cadeb7f

See more details on using hashes here.

File details

Details for the file PyPolkadot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: PyPolkadot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for PyPolkadot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3561cd72b24efbd410475daa8ec69fc02f023fa5c4a1469baa79451a8ccd9a08
MD5 28b0949518146b042f02e7684629d578
BLAKE2b-256 60e96b15d85bbb4a1e563a4a8e609057cd9fd7d0997e4c868643ec3a6a480ee6

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