Pycryptotools, Python library for crypto coin addresses and block explorers
This is a fork of Vitalik Buterin's original pybitcointools library.
It has been heavily modified and simplified to provide basic service such as:
- recovering address from a public key for various blockchain
- recovering wif from private key
- get the balance for a given address on a blockchain, using block explorer web services API
- get assets (token & NFT) linked to a given address on a blockchain
Since v0.4.0, the library focuses on these coin and explorer features: the transaction, wallet, BIP32
and mnemonic code inherited from pybitcointools has been removed. Use pycryptotools<0.4 if you need it.
Installation:
pip install pycryptotools
Library supports the following blockchains:
- Bitcoin mainnet & testnet
- Bitcoin Cash mainnet & testnet
- Litecoin mainnet & testnet
- Dogecoin mainnet & testnet
- Counterparty mainnet & testnet
- Ethereum mainnet & testnet
- Ethereum Classic mainnet & testnet
- Polygon mainnet & testnet
Requires Python 3.8 or later.
API keys
Coins take an optional apikeys dict, passed to their block explorers. Litecoin and Dogecoin
balances come from SoChain, whose API expects a key:
from pycryptotools.coins import Litecoin
coin = Litecoin(apikeys={'API_KEY_SOCHAIN': '...'})
coin.get_coin_info(address)
SoChain may reject or rate-limit requests sent without a key; get_coin_info() then raises
ValueError. The other supported coins need no API key.
Logging
The library logs through the standard logging module, under the pycryptotools logger, and is
silent by default. To see its output, configure logging in your application, or set the level of
all pycryptotools loggers at once:
import logging
import pycryptotools
logging.basicConfig()
pycryptotools.set_log_level(logging.DEBUG)
Note
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Metadata
Release files for pycryptotools 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycryptotools-0.4.1.tar.gz | 37.0 kB | Without provenance | Details for pycryptotools-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycryptotools-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for pycryptotools-0.4.1-py3-none-any.whl |
Total release size: 83.0 kB
Release files / pycryptotools-0.4.1.tar.gz
| Download URL | pycryptotools-0.4.1.tar.gz |
|---|---|
| Size | 37.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21c2928452cb8b2a6eb3bbf866734aeb2eb1fce52eebf89283a1ba824190aeed
|
|
BLAKE2b-256 checksum How to use checksums |
a416000397d04e4dc7087024705bb5298ab5be01c37123d1f0d2e315a1baecd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / pycryptotools-0.4.1-py3-none-any.whl
| Download URL | pycryptotools-0.4.1-py3-none-any.whl |
|---|---|
| Size | 46.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
21539a8f19537da79a57435d08f6f5e25fc5b5dab1b1bfc69e034ff1c227e391
|
|
BLAKE2b-256 checksum How to use checksums |
a5ba82a6cda836ac42fab4cb163f584e43863071a8eb8492f383f6b3c2e3c531
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for pycryptotools 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.