Skip to main content

Python library for interaction with Banano

Project description

License Build Status Documentation Status Supported Python Versions Package Version Banano Node Version

🍌🥧 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bananopy-0.3.3.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

bananopy-0.3.3-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

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