SHARE YOUR CODE: Using SteemTools to get accounts info
I came across @furion's post today and I immediately started trying to build stuff with it. I am a python noob and I enjoy creating short scripts that make your life simple.
Here is a program that allows you to search any account and get their basic info:
- Steem Power
- Account's Reputation
- Voting Power
- Average Payout per post
Any programmer can build such a script just by taking a quick glance at @furion's post, but here is the step by step guide for hobbyists like me:
1.- Open the Terminal in linux, if you don´t have linux you can get a cheap vps with Ubuntu on Vultr (that is my ref link, you can get $20 bonus with it).
2.- Install python3 and its dependencies:
sudo apt-get install python3-setuptools
sudo easy_install3 pip
3.- Install SteemTools:
pip install steemtools
4.- I recommend you build a folder for all your future steemtools scripts:
mkdir steemtools
5.- Go to the folder you just created:
cd steemtools
6.- Create the file for the script, you can name it whatever you want as long as it has .py at the end:
sudo nano overview.py
7.- paste this code inside the program:
from steemtools.base import Account
account = Account(input("enter account: "))
sp = account.get_sp()
print ("Steem Power ", sp)
rep = account.reputation()
print ("reputation ", rep)
voting = account.voting_power()
print ("voting power", voting, "%")
payout = account.avg_payout_per_post()
print ("average payout per post", payout)
8.- Press CTRL + X to quit the editor and Y to save it.
9.- Run the program:
python3 overview.py
And there you have it, you can repeat step 9 with as many accounts as you want and check their stats.
if you want to know your stats but don't want to install the script just drop a comment below and I can give you the info on your account
NOTE: If you don´t run your own node, please follow the @furion ´s instructions on his post´s comment: https://steemit.com/steemtools/@furion/ann-steemtools-a-high-level-python-library-for-steem
Very cool. Thanks for sharing:)
Cool!!!! Thanks for sharing the info. Appreciate it @chitty
I recommend using python console for experiments. This is much faster than writing the full script. Just enter python + enter and then for example:
The warnings that you see in the beginning are 'normal' when you are not using a local node but steem.ws node.
Another example here: https://steemit.com/steemtools/@cryptomental/steemtools-where-is-my-money-solved