Skip to main content

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


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

Uploaded Source

Built Distribution

bitcaviar-0.0.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file bitcaviar-0.0.2.tar.gz.

File metadata

  • Download URL: bitcaviar-0.0.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for bitcaviar-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0b067f12a1503e2d12030b6e5f94864b679123c07952ccce8c5be06fb0fa469f
MD5 97a463a8a502b342fa9cb7b232dd4808
BLAKE2b-256 d35269359b84f6dd1e6fa2857dfd7aa697137a7f832a160c4093ce715ea05b16

See more details on using hashes here.

File details

Details for the file bitcaviar-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: bitcaviar-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for bitcaviar-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8ddf05ffe66c784caa6ebd2ed4cc37f40ae425e3f52b7fefd0c1f91080d45e38
MD5 90dcd67cf13079ccaba5d1a6267b9eee
BLAKE2b-256 e99cb5f305249d46a1f8fbd7f18dcc01a88277f387939869757c920719434358

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page