-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
158 lines (91 loc) · 3.41 KB
/
main.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
from xml.dom.xmlbuilder import Options
import pandas as pd
import numpy as np
import datetime
import streamlit as st
from calculategrowth import *
from APIcallFunctions import *
import homepage
#from homepage import *
import projectpage
#from projectpage import *
from numpy import mean
import matplotlib.pyplot as plt
from PIL import Image
import time
import urllib.request
import plotly.graph_objects as go
st.set_page_config(layout="wide")
PAGES = {
"Industry Overview": projectpage,
"Project Statistics": homepage
}
st.sidebar.title('Navigation')
selection = st.sidebar.radio("Go to", list(PAGES.keys()))
page = PAGES[selection]
page.app()
### run streamlit by streamlit run main.py
#st.title("Crypto Twitter Analytics")
# Create a text element and let the reader know the data is loading.
#data_load_state = st.text('Loading data...')
# 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",]
# data0 = lineChart(ProjectName)
data = Avg_Change_by_Name()
#data2 = Rate_of_Change_Sector()
#data3 = Rate_of_Change_subSector()
data4 = Rate_of_Change_type()
#data5 = Rate_of_Change_Project()
#data6 =ProjectbySector(selection)
#data6 = PullProject_info()
#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')
#fig = go.Figure(data=data5)
#outputfig = fig.show()
## LOAD MAIN CHART
#def LoadFromOption(selection):
# data0 = lineChart(selection)
# return data0
#option = st.selectbox(
# 'Select Protocol', projectlist)
#st.write('You selected:', option)
## Load column 1 statistics
# data6 = PullProject_info() #attempting to run this function outside of the statsfromoption function to decrease load times
#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
#LAYOUT OF THE WEB APP
#col1, col2, col3 = st.columns([1,3,1])
#with col2:
# st.subheader('Twitter Follower Activity by Project')
# st.pyplot(LoadFromOption(option).figure)
# st.subheader("Average Rate of Change by sub Sector")
#st.write(data3)
#with col3:
# st.subheader("Average Rate of Change by Type")
# st.write(ProjectbySector(option))
# st.subheader("Average Rate of Change by Sector")
#st.write(data2)
#with col1:
# st.subheader("statistics for project")
# st.image(LoadImage(option))
# with st.spinner('Loading...'):
# time.sleep(2)
# st.write(StatsFromOption(option))
# st.write("Primary Account link")
# st.subheader('Twitter Follower Account Rate of Change')
# st.write(data)
#st.subheader("Average Rate of Change by Type")
#st.write(data4)
#st.subheader("Average Rate of Change by Project")
#st.write(data5)