You are viewing a single comment's thread from:

RE: Steem-python question

in #steem6 years ago (edited)

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))
Sort:  

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...

Coin Marketplace

STEEM 0.27
TRX 0.11
JST 0.031
BTC 67241.02
ETH 3727.25
USDT 1.00
SBD 3.77