Skip to main content

Pycryptotools, Python library for crypto coin addresses and block explorers

Latest Version

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycryptotools 0.4.0
File Size Uploaded Provenance Actions
pycryptotools-0.4.0.tar.gz 36.5 kB Without provenance Details for pycryptotools-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pycryptotools 0.4.0
File Interpreter ABI Platform Actions
pycryptotools-0.4.0-py3-none-any.whl Python 3 none any Details for pycryptotools-0.4.0-py3-none-any.whl

Total release size: 82.2 kB

Release files / pycryptotools-0.4.0.tar.gz

Download URL pycryptotools-0.4.0.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c78504a0bf43e6768759e953ceb89a6959cd28a41eedca0eb3be27a99e3ec354
BLAKE2b-256 checksum
How to use checksums
cc34cc925ed48e4adf7dee4ebea117273daaee2bd5e165ccc5e23ef81c5f6ceb
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.0-py3-none-any.whl

Download URL pycryptotools-0.4.0-py3-none-any.whl
Size 45.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6493665d8eb64551a0f4e21089ba8b3179a220aa4c239deba560c31c9185481a
BLAKE2b-256 checksum
How to use checksums
5e917b3a88b00783e5202edd4243a4284024ebf7145bdf121ed7fc35629c4d09
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.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page