A working solution with beem (pip install beem
installs it):
from beem import Steem
from beem.account import Account
from beem.snapshot import AccountSnapshot
if __name__ == "__main__":
stm = Steem()
account = Account("holger80", steem_instance=stm)
followers = account.get_followers()
print("%d accounts follow %s" % (len(followers), account["name"]))
ops = []
for op in account.history(only_ops=["delegate_vesting_shares"]):
ops.append(op)
acc_info = AccountSnapshot(account, account_history=ops, steem_instance=stm)
acc_info.build()
data = acc_info.get_data()
delegated_vests_in = data["delegated_vests_in"]
delegated_sp_in = {}
for d in delegated_vests_in:
delegated_sp_in[d] = stm.vests_to_sp(delegated_vests_in[d])
print("Incoming delegations: %s" % str(delegated_sp_in))
thanks a lot!
I think the Account.history function isn't available on steem-python. I should have started using beem earlier. Haha..
Posted using Partiko Android
Maybe I should also switch to beem...