Skip to main content

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

Release files for bitcaviar 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitcaviar 0.0.2
File Size Uploaded
bitcaviar-0.0.2.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bitcaviar 0.0.2
File Interpreter ABI Platform
bitcaviar-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size:12.8 kB

Release files / bitcaviar-0.0.2.tar.gz

Download URL bitcaviar-0.0.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0b067f12a1503e2d12030b6e5f94864b679123c07952ccce8c5be06fb0fa469f
BLAKE2b-256 checksum
How to use checksums
d35269359b84f6dd1e6fa2857dfd7aa697137a7f832a160c4093ce715ea05b16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / bitcaviar-0.0.2-py3-none-any.whl

Download URL bitcaviar-0.0.2-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ddf05ffe66c784caa6ebd2ed4cc37f40ae425e3f52b7fefd0c1f91080d45e38
BLAKE2b-256 checksum
How to use checksums
e99cb5f305249d46a1f8fbd7f18dcc01a88277f387939869757c920719434358
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page