How to Remind Yourself Where You Delegated Your Steem Power Using Python

in #steemit7 years ago (edited)

This post contains a Python script that uses the classes in the steem-python library and prints out to whom and how much a user has delegated their Steem Power. Python scripts can be run from the command line or inside of the IDLE that comes with Python.

Tips on installing and using steem-python on an Apple or Linux computer
Download and install steem-python
Download and install Python

# Find out to whom and how much SP a user delegates

from steem import Steem
from steem.amount import Amount
from steem.converter import Converter
s=Steem()
c=Converter()

# Substitute another username for 'numberjocky'.  Be sure to put it in quotes.

userName = 'numberjocky'

# Retrieve "steem per mvests" using the Converter object

stmPerMVests = c.steem_per_mvests()

# Get the delegating records of the user

delegatingRecords = s.get_vesting_delegations(userName,-1,100)

# Loop over the records and print out information

for record in delegatingRecords:
    delegaTee = record['delegatee']
    vestsDelegated = Amount(record['vesting_shares']).amount
    spDelegated = vestsDelegated/1000000*stmPerMVests
    print("%s delegates %.3f SP to %s" % (userName,spDelegated,delegaTee))

Enjoy!

Sort:  

Congratulations @numberjocky! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard!


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Thanks be to steemitboard!