forked from holgern/beem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
account_rep_over_time.py
38 lines (36 loc) · 1.2 KB
/
account_rep_over_time.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python
import sys
import datetime as dt
from beem.amount import Amount
from beem.utils import parse_time, formatTimeString, addTzInfo
from beem.instance import set_shared_steem_instance
from beem import Steem
from beem.snapshot import AccountSnapshot
import matplotlib as mpl
# mpl.use('Agg')
# mpl.use('TkAgg')
import matplotlib.pyplot as plt
if __name__ == "__main__":
if len(sys.argv) != 2:
# print("ERROR: command line parameter mismatch!")
# print("usage: %s [account]" % (sys.argv[0]))
account = "holger80"
else:
account = sys.argv[1]
acc_snapshot = AccountSnapshot(account)
acc_snapshot.get_account_history()
acc_snapshot.build(enable_in_votes=True)
acc_snapshot.build_rep_arrays()
timestamps = acc_snapshot.rep_timestamp
rep = acc_snapshot.rep
plt.figure(figsize=(12, 6))
opts = {'linestyle': '-', 'marker': '.'}
plt.plot_date(timestamps, rep, label="Reputation", **opts)
plt.grid()
plt.legend()
plt.title("Reputation over time - @%s" % (account))
plt.xlabel("Date")
plt.ylabel("Reputation over time")
# plt.show()
plt.savefig("reputation-%s.png" % (account))
print("last reputation %f" % (rep[-1]))