In [74]:
import pandas as pd
import numpy as np

import datetime as dt
from steemdata import SteemData

In [52]:
db = SteemData().db

In [ ]:

Revenue Estimate


In [65]:
conditions = {
    'created': '$gte': dt.datetime.now() - dt.timedelta(days=90),
    'total_payout_value.amount': {"$gt": 5},
    'tags': 'dtube'
}
projection = {
    '_id': 0,
    'author': 1,
    'total_payout_value.amount': 1,
}

In [66]:
posts = list(db['Posts'].find(conditions, projection))

In [67]:
len(posts)


Out[67]:
575

In [68]:
posts2 = [{
    "author": x['author'],
    "reward": x['total_payout_value']['amount']
} for x in posts]

In [69]:
posts2[0]


Out[69]:
{'author': 'broncnutz', 'reward': 22.216}

In [70]:
df = pd.DataFrame(posts2)

In [71]:
rewards = df[df.author != 'heimindanger'].sort_values('reward', ascending=False)
rewards.head()


Out[71]:
author reward
474 pressfortruth 320.075
329 jerrybanfield 204.148
176 jerrybanfield 202.328
422 dollarvigilante 194.092
391 hardfork-series 181.398

In [72]:
rewards['reward'].sum() / 4


Out[72]:
3624.527249999996

In [ ]:


In [ ]: