Python SDK for the Aleph.im network, next generation network of decentralized big data applications.
Development follows the Aleph Whitepaper.
The latest documentation, albeit incomplete, is available at https://docs.aleph.im/libraries/python-sdk/.
For the full documentation, please refer to the docstrings in the source code.
Some cryptographic functionalities use curve secp256k1 and require installing libsecp256k1.
$ apt-get install -y python3-pip libsecp256k1-devUsing some chains may also require installing libgmp3-dev.
This project does not support Python 3.12 on macOS. Please use Python 3.11 instead.
$ brew install secp256k1Using pip and PyPI:
$ pip install aleph-sdk-pythonSome functionalities require additional dependencies. They can be installed like this:
$ pip install aleph-sdk-python[solana, dns]The following extra dependencies are available:
- solanafor Solana accounts and signatures
- cosmosfor Substrate/Cosmos accounts and signatures
- nuls2for NULS2 accounts and signatures
- polkadotfor Polkadot accounts and signatures
- ledgerfor Ledger hardware wallet support, see Usage with LedgerHQ hardware
- mqttfor MQTT-related functionalities, see examples/mqtt.py
- docsfor building the documentation, see Documentation
- dnsfor DNS-related functionalities
- allinstalls all extra dependencies
Setup a virtual environment using hatch:
$ hatch shellThen install the SDK from source with all extra dependencies:
$ pip install -e .[all]You can use the test env defined for hatch to run the tests:
$ hatch run testing:runSee hatch env show for more information about all the environments and their scripts.
The documentation is built using Sphinx.
To build the documentation, install the SDK with the docs extra dependencies:
$ pip install -e .[docs]Then build the documentation:
$ cd docs
$ make htmlThe SDK supports signatures using app-ethereum, the Ethereum app for the Ledger hardware wallets.
This has been tested successfully on Linux (amd64). Let us know if it works for you on other operating systems.
Using a Ledger device on Linux requires root access or the setup of udev rules.
Unlocking the device is required before using the relevant SDK functions.
Install ledger-wallets-udev.
sudo apt-get install ledger-wallets-udev
Configure hardware.ledger.enable = true.