Quickstart¶
py-flexpoolapi is a pythonic library for easy interfacing with Flexpool Public API. The library has minimal dependencies which means it can be easy used inside every environment.
Installation¶
The recommended way is to install our PyPI package using pip.
pip3 install flexpoolapi
Note
You need to use pip
instead of pip3
if you’re using Windows.
However, you can always build it from source by
git clone https://github.com/flexpool/py-flexpoolapi
cd py-flexpoolapi
make install
Usage¶
Great! The py-flexpoolapi is installed successfully, you can check if it works by
>>> import flexpoolapi
>>> flexpoolapi.pool.hashrate()
{'EU1': 21818049812367, 'US1': 19274829582345, 'total': 41092879394712}
Quick example¶
>>> import flexpoolapi
# Pool
>>> flexpoolapi.pool.hashrate()
{'EU1': 21818049812367, 'US1': 19274829582345, 'total': 41092879394712}
>>> flexpoolapi.pool.miners_online()
47192
>>> flexpoolapi.pool.workers_online()
253194
# Miner
>>> miner = flexpoolapi.miner("0x8B82eE62Ae306BF1bE085458a08241759d1d7E20")
>>> miner.balance()
575311819007598793
>>> effective_hashrate, reported_hashrate = miner.current_hashrate()
(532256937, 497730709)
For better understanding, we recommend reading the documentation fully. If you don’t like reading documentation, you can always refer to the Examples Directory on GitHub.