A simple Python wrapper for Bitcoin JSON-RPC API
Project description
pybitcoin
A simple Python wrapper for Bitcoin JSON-RPC API.
Installation
pip install bitcaviar
Usage
You should pass your bitcoin-cli
directory and where you have the blockchain stored to each method.
from bitcaviar import config
bitcoin = config.Bitcoin(
cli_dir='your/dir/to/bitcoin-cli',
data_dir='/where/is/the/blockchain'
)
Example 1
Get the number of blocks in the blockchain
from bitcaviar import config
from bitcaviar import blockchain
def main():
bitcoin = config.Bitcoin(
cli_dir='bitcoin-cli',
data_dir='/Users/dennis/Bitcoin'
)
block_count = blockchain.get_block_count(bitcoin=bitcoin)
print(block_count)
if __name__ == '__main__':
main()
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
bitcaviar-0.0.2.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for bitcaviar-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ddf05ffe66c784caa6ebd2ed4cc37f40ae425e3f52b7fefd0c1f91080d45e38 |
|
MD5 | 90dcd67cf13079ccaba5d1a6267b9eee |
|
BLAKE2b-256 | e99cb5f305249d46a1f8fbd7f18dcc01a88277f387939869757c920719434358 |