https://github.com/chainstack/bitcoincli
A Python wrapper for Bitcoin JSON-RPC API
https://github.com/chainstack/bitcoincli
bitcoin cli json-rpc python-library
Last synced: about 2 months ago
JSON representation
A Python wrapper for Bitcoin JSON-RPC API
- Host: GitHub
- URL: https://github.com/chainstack/bitcoincli
- Owner: chainstack
- License: bsd-3-clause
- Fork: true (jgarzik/python-bitcoinrpc)
- Created: 2019-11-13T06:31:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T07:48:17.000Z (over 6 years ago)
- Last Synced: 2026-01-03T16:27:26.976Z (2 months ago)
- Topics: bitcoin, cli, json-rpc, python-library
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 9
- Watchers: 0
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bitcoincli
[](https://circleci.com/gh/chainstack/bitcoincli/tree/master)
[](https://badge.fury.io/py/bitcoincli)
## Description
Heavily based on [python-bitcoinrpc](https://github.com/jgarzik/python-bitcoinrpc) and [Savoir](https://github.com/DXMarkets/Savoir) but replacing the httplib with [requests](http://docs.python-requests.org/en/master/).
## Installation
``` sh
git clone https://github.com/chainstack/bitcoincli
```
## Usage
After cloning this repository, run:
``` sh
python setup.py develop
```
Use the [Bitcoin API documentacion](https://bitcoin.org/en/developer-reference#bitcoin-core-apis) and make calls to the wrapper.
Remember to replace the RPC variables with your Bitcoin node access credentials.
```python
from bitcoincli import Bitcoin
host = "nd-123-456-789.p2pify.com"
port = "80"
username = "user-name"
password = "pass-word-pass-word-pass-word"
bitcoin = Bitcoin(username, password, host, port)
info = bitcoin.getblockchaininfo()
print(info)
```