Python library for interaction with Banano
Project description
🍌🥧 is a python wrapper for Banano node communication. It takes care of RPC responses (type conversions) and exposes a pythonic API for making RPC calls.
Full list of RPC calls is coming from docs.
Setup
pip install bananopy
Bananopy checks if BANANO_HTTP_PROVIDER_URI environment variable is set.
To set it run:
export BANANO_HTTP_PROVIDER_URI=<ip_address>
Otherwise, bananopy will fallback and use public node (https://api-beta.banano.cc) for API calls.
Note: Public node is running Banano Node v18, meaning some requests might fail.
Development
Repository uses poetry to keep track of dependances. Once you have poetry installed make sure you are on Python 3.7+ and run these commands:
git clone https://github.com/milkyklim/bananopy.git
poetry install
To run the tests:
poetry run pytest -v
Note: Only public requests are actually tested. Dangerous RPC calls controlled by enable_control are checked for error response only.
Conversion
float type is not supported in conversion, e.g. ban_to_banoshi cause it might lead to unexpected precision loss. Use str, int or Decimal types instead.
Example
>>> import bananopy.banano as ban
Using https://api-beta.banano.cc as API provider on port 443
>>> account = "ban_1bananobh5rat99qfgt1ptpieie5swmoth87thi74qgbfrij7dcgjiij94xr"
>>> ban.account_balance(account)
{'balance': 1626688000000000000017763568393401, 'pending': 0}
Support
Benis to ban_1dsarukqn5y8oqho43praocn97wjs17t8eppzgfb78nzzxmjapkidxrcgsqc
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
Built Distribution
File details
Details for the file bananopy-0.3.3.tar.gz
.
File metadata
- Download URL: bananopy-0.3.3.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.6.7 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69473db3ad454b147363a48c7546bbbe4d6a7a384363852f01465b29c9ccb62c |
|
MD5 | 237fbf038114d2a01df45cd6ef36a202 |
|
BLAKE2b-256 | b89bb6b975c12d81e294bbc7c8e5d4fb4a9de66408afdc5012b2086d9ebda8d6 |
File details
Details for the file bananopy-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: bananopy-0.3.3-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.6.7 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 863b23a5465172bd2b40af16bbf24fc0891c56df6a096a6f0458b56db9c1c1a6 |
|
MD5 | 0525d550c3e6ef527d2215af16598b08 |
|
BLAKE2b-256 | 7209c94b9fb8295ff1245cc8dd6e88251d3e1820058025034caf2efbead663fc |