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 |
✔ |
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
Project details
Release history Release notifications | RSS feed
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.2.4.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for bitcoinrpc-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c47e5f774c3ee897460c67d9256e68115398f63a77e3c56b3e2c95b98a7b35a8 |
|
MD5 | 1aa1a187d697b653ae2e2969de19fb25 |
|
BLAKE2b-256 | 958f08dd7e13f79a8ec2a1dd6c4f363d84b7f47d8fe0c1d5b4f33f44c3d5094e |