This release is a pre-release and may not be stable for production use.
skale.py
Python client library used in SKALE network components.
- Python 3.11+ support
- Compatibility with
web3.pyv7
Installation
pip install skale.py
Usage
Supported wallets
- Ledger Wallet (works with Ledger Nano S and other models)
- RPC Wallet (works with SKALE Transactions Manager)
- SGX Wallet (works with SKALE SGX Wallet)
- Web3 Wallet (works with
web3.pyproviders and private keys in memory)
Library initialization
With Web3Wallet (private key in memory):
from skale import SkaleManager
from skale.wallets import Web3Wallet
from skale.utils.web3_utils import init_web3
web3 = init_web3(ENDPOINT)
wallet = Web3Wallet(private_key, web3)
skale = Skale(ENDPOINT, ABI_FILEPATH, wallet)
With external transactions manager:
from skale import SkaleManager
from skale.wallets import RPCWallet
web3 = init_web3(ENDPOINT)
wallet = RPCWallet(TM_URL)
skale = Skale(ENDPOINT, ABI_FILEPATH, wallet)
Interactions with SKALE contracts
active_nodes = skale.nodes.active_node_ips()
schains = skale.schains.schains_for_owner('0x...')
Working in multiple threads
Due to the web3.py v5 limitations you have to create separate instances of the skale.py for the each thread.
Take a look on the tests/multithreading_test.py for the reference.
Development
Add pre-commit hook:
nano .git/hooks/pre-commit
uv run ruff check skale/
uv run mypy skale/
Install local version
uv sync --all-extras
Export environment variables
To export environment variables for running tests locally, run:
. ./scripts/export_env.sh
Build and publish library
bash build_and_publish.sh major/minor/patch
If you're using .env file
export $(cat .env | xargs) && bash build_and_publish.sh major/minor/patch
Versioning
The version scheme for this repo is {major}.{minor}.{patch}
For more details see: https://semver.org/
License
All contributions are made under the GNU Affero General Public License v3. See LICENSE.
Metadata
Release files for skale.py 7.14.dev5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| skale_py-7.14.dev5.tar.gz | 165.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| skale_py-7.14.dev5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 351.7 kB
Release files / skale_py-7.14.dev5.tar.gz
| Download URL | skale_py-7.14.dev5.tar.gz |
|---|---|
| Size | 165.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d37262e0695f280add686efa522b8f981c4bf88e2024cb3ef508938f410d21b
|
|
BLAKE2b-256 checksum How to use checksums |
30259498e2c44ca38e8bbd566f3b4fa29f93d0050672b20e4f86a6756aa3affb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / skale_py-7.14.dev5-py3-none-any.whl
| Download URL | skale_py-7.14.dev5-py3-none-any.whl |
|---|---|
| Size | 186.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2257da015d72345e0c71b22c952816a2451db002485cea952221d48ad10fc10
|
|
BLAKE2b-256 checksum How to use checksums |
0885b62d66e13bcad920a9f70bbc69c500d6e6df6dbccbb1984edf13db6a0f9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|