Skip to main content

Any coin (Bitcoin, Litecoin, Dogecoin..) RPC client and utilities for Python.

Project description

TinyCoinLib (pre-release, v0.0.1)

A minimalistic any coin (Bitcoin, Litecoin, Dogecoin..) RPC client and utilities for Python 3.

  • Tiny
  • Easy to review
  • Free and open source (GPLv3)
  • No external dependencies
  • No API breaking changes in horizon

It allows you to build Python programs that

Warning! TinyCoinLib comes without any warranty. Improper use or software bugs can lead to loss of coins. Run only on trusted platforms. Proceed at your own risk.

Warning! TinyCoinLib is in early development and not production ready yet. Its features remain mainly untested. This will change in future revisions.

Warning! Pre-release versions (v.0.0.Z) are completely untested. Functionality is likely broken.

💿 Installing

First, install TinyCoinLib form the Python Package Index

pip install tinycoinlib

Next, download the Core Wallet from a trusted source and verify its integrity (checksums and signature). Start the bundled coind program (bitcoind, litecoind, dogecoind, ...) and wait for the blockchain to synchronise.

Then you are ready to go.

📚 Examples

1) General RPC commands

from tinycoinlib.talk import TinyCoinTalk

talker = TinyCoinTalk('litecoin')
response = talker.call('getblockhash 69')

The constructor takes a URL as its first parameter. It points to the {}coind RPC server or is a special value listed in the PRESET_PORTS dictionary.

The call method takes in a command and returns the server's response.

2) Accept payments (receive coins)

from tinycoinlib.receive import TinyCoinReceive

receiver = TinyCoinReceive('127.0.0.1:18933')
trans_id = 'my-transaction-id'

paymend_address = receiver.get_payment_address(trans_id)
is_complete, amount = receiver.payment_completed(trans_id, 42)

The get_payment_address method adds (if not already existing) a receive address with the label my-transaction-id to the Core wallet. The payment_completed method checks if the payment has been completed (42 or more coins in the address).

3) Make payments (send coins)

from tinycoinlib.send import TinyCoinSend

sender = TinyCoinSend('dogecoin')

transaction_id = sender.send(1.38, 'DMrzmskQzXJ9pDHQBxBu5de36UaH5EYtDa')

TinyCoinSend has two more methods, get_balance and get_details for wallet balance and transaction details (confirmations, fee, ...) enquery, respectively.

Contributing

For bugs and ideas, please see our Issues. Further details are in CONTRIBUTING.md.

☕Supporting the project

Financial support is highly appreciated as it allows me (BigCoinBoy) to work on this project

Thank you to everyone who has donated!

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

tinycoinlib-0.0.1.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

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

tinycoinlib-0.0.1-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file tinycoinlib-0.0.1.tar.gz.

File metadata

  • Download URL: tinycoinlib-0.0.1.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for tinycoinlib-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b9a5c9f050b446918e4a8e69d0cce7d8fbf96e0e4c801bbf777787bf8168fda4
MD5 1d389e4392e96a5171e8806a6fe96fce
BLAKE2b-256 25762dfe2cd3cef59beb930300fc73feb4ec7aa6d2464a9053735bd987ca7917

See more details on using hashes here.

File details

Details for the file tinycoinlib-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tinycoinlib-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for tinycoinlib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c4f85b205d01a1d729fc98925a93c9df96e29478c91994e31f68d1e6787c6f0
MD5 5f98dd60f1e8c6a13c5860d9d51042c8
BLAKE2b-256 28192002adaa9843a799f55700b08d915298232a22b320d2439f6fc956263719

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