🐍 Pythonic wrapper for Flexpool API v2
Project description
py-flexpoolapi-v2
Structured Python wrapper for Flexpool.io 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 to snake_case.
Undocumented endpoints added
Miner API
/miner/details(GET)/miner/payoutSettings(POST)/miner/notificationSettings(POST)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flexpoolapi-v2-2.2.4.post7.tar.gz.
File metadata
- Download URL: flexpoolapi-v2-2.2.4.post7.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54776a2110faba733eeecb69f5ee7952c0a0a2bbfdca64622340374790f85182
|
|
| MD5 |
68e55a4d29969cdc19fee6b7a93dfd92
|
|
| BLAKE2b-256 |
72ecfa2f8d807514776d65d6727edcd2fd9e625146cb098afaf934571b5ce3e9
|
File details
Details for the file flexpoolapi_v2-2.2.4.post7-py3-none-any.whl.
File metadata
- Download URL: flexpoolapi_v2-2.2.4.post7-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14eb980f456d2343788edcb39f64249687d84ee2c47a4885148d0b54088e2c02
|
|
| MD5 |
baa31445a85354041f095405dc902220
|
|
| BLAKE2b-256 |
7e29e9326717099283bff32ee6dfc61d71f0419713269d0294d45bc4403c666f
|