-
Notifications
You must be signed in to change notification settings - Fork 0
/
homepage.py
76 lines (55 loc) · 2.21 KB
/
homepage.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# app1.py
import streamlit as st
#from main import *
from APIcallFunctions import *
from calculategrowth import *
import urllib.request
from xml.dom.xmlbuilder import Options
import pandas as pd
import numpy as np
import datetime
from PIL import Image
import time
import plotly.graph_objects as go
import plotly.express as px
# List of all available projects (need to update regularly as new ones are added)
projectlist = ["Premia.Finance","PoolTogether","Luna","Aave","Zcash","Monero","USDC","USDT","Fantom","Nexus Mutual","Crypto Punks","Bored Ape Yacht Club","NessGraphics","SushiSwap","Dogami","Bitcoin","Ethereum",]
data6 = PullProject_info() #attempting to run this function outside of the statsfromoption function to decrease load times
#def LoadFromOption(selection):
# data0 = lineChart2(selection)
# return data0
def StatsFromOption(selection):
#data6 = PullProject_info()
results = data6.loc[selection]
new = results.to_frame()
newString = new.astype(str)
return newString
## load image
def LoadImage(selection):
data7 = data6.transpose()
data8 = data7[selection]
pic = data8.iloc[5]
urllib.request.urlretrieve(pic,"logo.jpg")
im = Image.open("logo.jpg")
return im
def app():
st.title("Crypto Twitter Analytics")
data_load_state = st.text('Loading data...')
data_load_state.text('This site aims to provide actionable investing insights for the growth of Twitter Handles among various projects in the Crypto space')
option = st.selectbox(
'Select Protocol', projectlist)
st.write('You selected:', option)
col1, col2 = st.columns([1,2])
with col2:
st.subheader('Twitter Follower Activity by Project')
st.plotly_chart(lineChart2(option))
#st.subheader("Average Rate of Change by sub Sector")
#st.write(data3)
with col1:
st.subheader("statistics for project")
st.image(LoadImage(option))
with st.spinner('Loading...'):
time.sleep(2)
st.write(StatsFromOption(option))
st.subheader("Average Rate of Change within the Sector")
st.write(ProjectbySector(option))