Skip to main content

Lightweight Bitcoin JSON-RPC Python asynchronous client

Project description

bitcoin-python-async-rpc

Lightweight Bitcoin async JSON-RPC Python client.

Serves as a tiny layer between an application and a Bitcoin daemon, its primary usage is querying the current state of Bitcoin blockchain, network stats, transactions...

If you want complete Bitcoin experience in Python, consult python-bitcoinlib.

Installation

$ pip install bitcoinrpc

Supported methods

Here is a list of supported methods, divided by their categories. Should you need method not implemented, wrap the call in BitcoinRPC.acall(<your_method>, ...) coroutine.

Blockchain

Method Supported?
getbestblockhash
getblock
getblockchaininfo
getblockhash
getblockheader
getblockstats
getchaintips
getdifficulty
getmempoolinfo
getnetworkhashps

Mining

Method Supported?
getmininginfo

Network

Method Supported?
getconnectioncount
getnetworkinfo

Raw transactions

Method Supported?
getrawtransaction

Usage

Minimal illustration (assuming Python 3.8, where you can run async code in console)

$ python -m asyncio
>>> import asyncio
>>>
>>> from bitcoinrpc import BitcoinRPC
>>> rpc = BitcoinRPC("127.0.0.1", 8332, "rpc_user", "rpc_passwd")
>>> await rpc.getconnectioncount()
10

License

MIT

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

bitcoinrpc-0.3.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

bitcoinrpc-0.3.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file bitcoinrpc-0.3.0.tar.gz.

File metadata

  • Download URL: bitcoinrpc-0.3.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

File hashes

Hashes for bitcoinrpc-0.3.0.tar.gz
Algorithm Hash digest
SHA256 236104ffd29a91d23ca099ea89614146d285b190c50bcf120321450d80d822ae
MD5 a3431a5c6cce8d21d8976803147e9f0a
BLAKE2b-256 1866940955934618ab00dc4472cd9165fe03221cdc8ef282a7174aecb9787cac

See more details on using hashes here.

File details

Details for the file bitcoinrpc-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: bitcoinrpc-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

File hashes

Hashes for bitcoinrpc-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5d797a3357d6870d435a0bf5dd8f860612f95da189cad2ac65462c8b89aa8aa
MD5 b7c8bc71ef3882e612fabf7fe381fd5d
BLAKE2b-256 3e792381fe96460e27571ed09f31dd51577513cf12e5acb4df28a65e6034763a

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