If you have been using Steempy (and possibly others) you probably realize that the Voting Power returned does not update until the User votes.
For example if I Up Vote a post and have 98% Voting Power remaining, then wait 3 hours, my Voting Power will be back at 100%. However Steempy does not reflect the change. Instead it will return the Voting Power at the time of my last vote (98%).
I calculated that the rate of Voting Power replenishment is 20%/24hrs or approximately 0.000228898%/second. Using this combined with the Last Voting Timestamp I wrote a little python function that works around this issue until this is fixed upstream:
from steem import utils
def get_correct_voting_power(vp, last_vote_time):
VP_REPLENISH_RATE_PER_SECOND = 0.000228898
delta = utils.time_elapsed(last_vote_time).total_seconds()
vpoffset = delta*VP_REPLENISH_RATE_PER_SECOND*100
realVP = int(float(vp) + float(vpoffset))
if (realVP > 10000):
realVP = 10000
return realVP
Example use:
from steem import Steem
s = Steem()
# grab account information and fix voting power
account = s.steemd.get_account("bigdeej")
vp = get_correct_voting_power(account["voting_power"], account["last_vote_time"])
Hope that helps anyone who ran into this issue as I did! Super quick and easy workaround. This code I have tested for 3 weeks and have found it to be within 0.02% accurate of what steemd reports!