🐍 Pythonic wrapper for Flexpool API v2
Project description
py-flexpoolapi-v2
Structured Python wrapper for Flexpool API v2.
Installation
Install py-flexpoolapi-v2.
Using pip
pip3 install flexpoolapi-v2
Build from source
git clone https://github.com/nekusu/py-flexpoolapi-v2.git
cd py-flexpoolapi-v2
pip3 install -r requirements.txt
sudo make install # or `sudo python3 setup.py install`
Usage
Quick example:
>>> import flexpoolapi
>>> from flexpoolapi.utils import *
# Coins
>>> coins = flexpoolapi.poolapi.coins()
>>> coins[0].name
'Ethereum'
>>> coins[1].name
'Chia'
# ETH Pool
>>> eth_pool = flexpoolapi.pool("eth")
>>> format_hashrate(eth_pool.hashrate().total, "eth")
'11.2 TH/s'
>>> eth_pool.miner_count()
20600
>>> eth_pool.worker_count()
50987
# XCH Pool
>>> xch_pool = flexpoolapi.pool("xch")
>>> format_hashrate(xch_pool.hashrate().total, "xch")
'207.9 PB'
>>> xch_pool.miner_count()
3530
>>> xch_pool.worker_count()
4933
# ETH Miner
>>> eth_miner = flexpoolapi.miner("eth", eth_pool.top_miners()[0].address)
>>> format_decimals(eth_miner.balance().balance, "eth")
'1.01524 ETH'
>>> format_hashrate(eth_miner.stats().current_effective_hashrate, "eth")
'1.6 TH/s'
# XCH Miner
>>> xch_miner = flexpoolapi.miner("xch", xch_pool.top_miners()[0].address)
>>> format_decimals(xch_miner.balance().balance, "xch")
'0.1692 XCH'
>>> format_hashrate(xch_miner.stats().current_effective_hashrate, "xch")
'2.3 PB'
# Locate Address
>>> flexpoolapi.minerapi.locate_address(eth_pool.top_miners()[0].address)
'eth'
For better understanding, I recommend reading the Flexpool APIv2 documentation. All variables/functions names were renamed from camelCase (JavaScript) to snake_case (Python).
License
MIT - Copyright (c) 2020 Flexpool
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
flexpoolapi-v2-2.2.4.post5.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for flexpoolapi-v2-2.2.4.post5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd4f0d373af55cc816620e09767b9156ee33b72ab0ff91e51ace09006bac967 |
|
MD5 | d0347c80a0d2bcff12a9f68e3448032f |
|
BLAKE2b-256 | 0af1763d5e4f370a4540e7c26e9dde12d2e27ada3490c904e3c4548dd6137a57 |
Close
Hashes for flexpoolapi_v2-2.2.4.post5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59aec271acf61f58f75003d22cbfda528005290e3656819e579929f78f6defc2 |
|
MD5 | 7c0911f68d17e5298245531b3d939753 |
|
BLAKE2b-256 | 669ba305de15169c5d5d3511e2bdc703883c2ea464fc60c6b789274c6e240fac |