aus10powell commited on
Commit
0e806c4
1 Parent(s): 15ffbd1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -22,6 +22,7 @@ import scripts.twitter_scraper as ts
22
  import scripts.utils as utils
23
  from scripts import generative
24
  import nltk
 
25
 
26
  logging.basicConfig(level=logging.INFO)
27
 
@@ -57,7 +58,12 @@ def get_accounts() -> List[dict]:
57
  account_info_list = [
58
  ts.get_twitter_account_info(twitter_handle=account) for account in username_list
59
  ]
60
- return account_info_list
 
 
 
 
 
61
 
62
 
63
  @app.get("/tweets/{username}", response_model=dict)
 
22
  import scripts.utils as utils
23
  from scripts import generative
24
  import nltk
25
+ import pandas as pd
26
 
27
  logging.basicConfig(level=logging.INFO)
28
 
 
58
  account_info_list = [
59
  ts.get_twitter_account_info(twitter_handle=account) for account in username_list
60
  ]
61
+ df_account = pd.DataFrame(account_info_list)
62
+ df_account = df_account.style.bar( subset=["follower_count", "friends_count"],color='#d65f5f')
63
+ df_account = df_account.format({"follower_count": "{:,.0f}", "friends_count": "{:,.0f}"})
64
+ return HTMLResponse(content= df_account.to_html(classes='center'), status_code=200)
65
+
66
+
67
 
68
 
69
  @app.get("/tweets/{username}", response_model=dict)