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 |
✔ |
getblockcount |
✔ |
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
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.3.1.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for bitcoinrpc-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fc1ae4328cc8914e2f58a3fbe426f1e439b24c16a01ff8d83d604fbdcdaacd4 |
|
MD5 | 5f94ffba715905448f25fd8bb7a5b0a7 |
|
BLAKE2b-256 | ba02c71fefe1073adcca555f88d1ba11565637f9f40c3b7b9ec24d4387aa3d03 |