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


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 details)

Uploaded Source

Built Distribution

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

bitcoinrpc-0.3.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitcoinrpc-0.3.1.tar.gz
  • Upload date:
  • Size: 6.6 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.49.0 CPython/3.8.2

File hashes

Hashes for bitcoinrpc-0.3.1.tar.gz
Algorithm Hash digest
SHA256 807fe1d017d772a581e8a062c7985ff19e037a6145c62ef198c5c71a2d2deb88
MD5 8eb56db700700e76ae4f0a5fcde7165a
BLAKE2b-256 198ae30709626dc7bf5bbc3cf5567f2e62842abd0385c3b0cf40559a75cd4894

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitcoinrpc-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.49.0 CPython/3.8.2

File hashes

Hashes for bitcoinrpc-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3fc1ae4328cc8914e2f58a3fbe426f1e439b24c16a01ff8d83d604fbdcdaacd4
MD5 5f94ffba715905448f25fd8bb7a5b0a7
BLAKE2b-256 ba02c71fefe1073adcca555f88d1ba11565637f9f40c3b7b9ec24d4387aa3d03

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