Quick'n dirty python script for fetching your account balance

in #steem8 years ago (edited)

Here goes a quick'n dirty python script for fetching your account balance converted to a fiat currency.
e.g.

$ python steem_balance.py dan
Steem balance
Steem vests: 9891.00M (7371712.54 euros)
Steem: 0.437 (1.49 euros)
Steem Dollars: 3.000 (2.69 euros)
Total: 7371716.72 euros

It requires python 3, lxml and requests.

Sort:  

Nice. I forked it and made currency an argument. The word 'euro' is still used in variable names though, for the sake of quickness and dirtiness.

$ python steem_balance.py -u dan -c usd
Steem balance
Steem vests: 9891.00M (7963087.82 usd)
Steem: 0.437 (1.61 usd)
Steem Dollars: 3.000 (3.00 usd)
Total: 7963092.43 usd

Well done!

Very nice. I noticed coinm.get_price() can be called with True as the second input, and the output is converted to dollars. Though it still is hardcoded to report "euros" in print_balance.

My fellow Americans, just change line 43 to:
ratio_steem_fiat = coinm.get_price('STEEM',True)

If you're running it in linux, and don't feel like manually finding and replacing the 'euros', run this command in a terminal in the folder with the script:

sed -i -- 's/euros/Dollars/g' steem_balance.py

Coin Marketplace

STEEM 0.20
TRX 0.26
JST 0.040
BTC 100536.03
ETH 3616.02
USDT 1.00
SBD 3.12