Ronio Jerico Roque commited on
Commit
2f70cff
Β·
1 Parent(s): 2a933b6

Fix: Name Tags

Browse files
classes/Off_Page.py CHANGED
@@ -60,17 +60,18 @@ class SeoOffPageAnalyst:
60
  }
61
 
62
  df_output = pd.DataFrame(data)
 
63
  with st.expander("AI Analysis", expanded=True, icon="πŸ€–"):
64
  st.table(df_output.style.set_table_styles(
65
  [{'selector': 'th:first-child, td:first-child', 'props': [('width', '20px')]},
66
  {'selector': 'th, td', 'props': [('width', '150px'), ('text-align', 'center')]}]
67
  ).set_properties(**{'text-align': 'center'}))
68
-
69
  return output
70
 
71
  def row1(self):
72
  #st.write(self.data_src)
73
- self.uploaded_files = st.file_uploader('Backlinks (SEO Off Page)', type=['pdf', 'csv'], accept_multiple_files=True, key="seo_off")
74
  if self.uploaded_files:
75
  upload.multiple_upload_file(self.uploaded_files)
76
 
@@ -78,11 +79,8 @@ class SeoOffPageAnalyst:
78
  #st.write("") # FOR THE HIDE BUTTON
79
 
80
  st.session_state['analyzing'] = False
81
-
82
  start_time = time.time()
83
- if st.session_state['analyze'] == 'clicked':
84
-
85
- if self.uploaded_files:
86
  combined_text = ""
87
  with st.spinner('SEO Off Page Analyst...', show_time=True):
88
  st.write('')
@@ -114,12 +112,11 @@ class SeoOffPageAnalyst:
114
 
115
  collect_telemetry(debug_info)
116
 
117
- with st.expander("Debug information", icon="βš™"):
118
- st.write(debug_info)
119
-
120
  st.session_state['analyzing'] = False
121
- st.session_state['analyze'] == ''
122
-
123
 
124
  if __name__ == "__main__":
125
  st.set_page_config(layout="wide")
 
60
  }
61
 
62
  df_output = pd.DataFrame(data)
63
+ '''
64
  with st.expander("AI Analysis", expanded=True, icon="πŸ€–"):
65
  st.table(df_output.style.set_table_styles(
66
  [{'selector': 'th:first-child, td:first-child', 'props': [('width', '20px')]},
67
  {'selector': 'th, td', 'props': [('width', '150px'), ('text-align', 'center')]}]
68
  ).set_properties(**{'text-align': 'center'}))
69
+ '''
70
  return output
71
 
72
  def row1(self):
73
  #st.write(self.data_src)
74
+ self.uploaded_files = st.file_uploader('Backlinks - SEMRush', type='csv', accept_multiple_files=True, key="seo_off")
75
  if self.uploaded_files:
76
  upload.multiple_upload_file(self.uploaded_files)
77
 
 
79
  #st.write("") # FOR THE HIDE BUTTON
80
 
81
  st.session_state['analyzing'] = False
 
82
  start_time = time.time()
83
+ if self.uploaded_files and st.session_state['analyze'] == 'clicked':
 
 
84
  combined_text = ""
85
  with st.spinner('SEO Off Page Analyst...', show_time=True):
86
  st.write('')
 
112
 
113
  collect_telemetry(debug_info)
114
 
115
+ #with st.expander("Debug information", icon="βš™"):
116
+ # st.write(debug_info)
117
+ print("done2")
118
  st.session_state['analyzing'] = False
119
+
 
120
 
121
  if __name__ == "__main__":
122
  st.set_page_config(layout="wide")
classes/On_Page_Crawl.py CHANGED
@@ -75,7 +75,7 @@ class SeoOnCrawl:
75
 
76
  def row1(self):
77
  #st.write(self.data_src)
78
- self.uploaded_files = st.file_uploader("Crawl File (SEO On Page)", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on_backlink")
79
  #self.gtmetrix = st.file_uploader("GTmetrix", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on_gt")
80
  if self.uploaded_files:
81
  upload.multiple_upload_file(self.uploaded_files)
 
75
 
76
  def row1(self):
77
  #st.write(self.data_src)
78
+ self.uploaded_files = st.file_uploader("Crawl File - ScreamingFrog:", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on_backlink")
79
  #self.gtmetrix = st.file_uploader("GTmetrix", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on_gt")
80
  if self.uploaded_files:
81
  upload.multiple_upload_file(self.uploaded_files)
classes/On_Page_GT.py CHANGED
@@ -76,7 +76,7 @@ class SeoOnGT:
76
  def row1(self):
77
  #st.write(self.data_src)
78
  #self.uploaded_files = st.file_uploader("Upload Backlink List (PDF)", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on")
79
- self.gtmetrix = st.file_uploader("GTmetrix", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on_gt")
80
  '''
81
  if self.uploaded_files:
82
  upload.multiple_upload_file(self.uploaded_files)
@@ -84,7 +84,14 @@ class SeoOnGT:
84
  '''
85
  if self.gtmetrix:
86
  upload.upload_gt(self.gtmetrix)
87
-
 
 
 
 
 
 
 
88
  #st.write("") # FOR THE HIDE BUTTON
89
  #st.write("") # FOR THE HIDE BUTTON
90
  #st.write("AI Analyst Output: ")
@@ -118,6 +125,15 @@ class SeoOnGT:
118
  combined_text += f['content'].to_csv(index=True) + "\n"
119
  except KeyError:
120
  pass
 
 
 
 
 
 
 
 
 
121
  # OUTPUT FOR SEO ANALYST
122
  payload_txt = {"question": combined_text}
123
  result = self.request_model(payload_txt)
 
76
  def row1(self):
77
  #st.write(self.data_src)
78
  #self.uploaded_files = st.file_uploader("Upload Backlink List (PDF)", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on")
79
+ self.gtmetrix = st.file_uploader("GTmetrix:", type=['pdf', 'csv'], accept_multiple_files=True, key="seo_on_gt")
80
  '''
81
  if self.uploaded_files:
82
  upload.multiple_upload_file(self.uploaded_files)
 
84
  '''
85
  if self.gtmetrix:
86
  upload.upload_gt(self.gtmetrix)
87
+
88
+ self.website_responsiveness = st.text_input("Website Responsiveness - Google PageSpeed Insight:", placeholder='Enter Website Responsiveness')
89
+ self.content_management_system = st.text_input("Content Management System - BuiltWith:", placeholder='Enter Content Management System')
90
+ self.SSL_certificate = st.text_input("SSL Certificate - BuiltWith:", placeholder='Enter SSL Certificate')
91
+ self.web_analytics = st.text_input("Web Analytics - BuiltWith:", placeholder='Enter Web Analytics')
92
+ self.client_relations_management_system = st.text_input("Client Relations Management System - BuiltWith:", placeholder='Enter Client Relations Management System')
93
+ self.lead_generation_mechanism = st.text_input("Lead Generation Mechanism - Business Context (Lead Generation & Lead Nurturing):", placeholder='Enter Lead Generation Mechanism')
94
+
95
  #st.write("") # FOR THE HIDE BUTTON
96
  #st.write("") # FOR THE HIDE BUTTON
97
  #st.write("AI Analyst Output: ")
 
125
  combined_text += f['content'].to_csv(index=True) + "\n"
126
  except KeyError:
127
  pass
128
+ try:
129
+ combined_text += f"\nWebsite Responsiveness: {self.website_responsiveness}"
130
+ combined_text += f"\nContent Management System: {self.content_management_system}%"
131
+ combined_text += f"\nSSL Certificate: {self.SSL_certificate}"
132
+ combined_text += f"\nWeb Analytics: {self.web_analytics}"
133
+ combined_text += f"\nClient Relations Management System: {self.client_relations_management_system}"
134
+ combined_text += f"\nLead Generation Mechanism: {self.lead_generation_mechanism}"
135
+ except KeyError:
136
+ pass
137
  # OUTPUT FOR SEO ANALYST
138
  payload_txt = {"question": combined_text}
139
  result = self.request_model(payload_txt)
classes/Seo.py CHANGED
@@ -159,7 +159,7 @@ class Seo:
159
  self.file_dict = upload.file_dict
160
  '''
161
  #st.write("") # FOR THE HIDE BUTTON
162
- self.uploaded_file_seo = st.file_uploader("SEO Keywords (CSV) - SEO", type='csv', key="seo2")
163
  if self.uploaded_file_seo:
164
  self.delete_sessions()
165
  try:
@@ -169,7 +169,7 @@ class Seo:
169
  pass
170
 
171
 
172
- self.uploaded_file = st.file_uploader("Traffic Channels (SEMRush) (CSV) - SEO", type='csv')
173
  if self.uploaded_file:
174
  self.delete_sessions()
175
  try:
@@ -179,7 +179,7 @@ class Seo:
179
  pass
180
 
181
  st.write("") # FOR THE HIDE BUTTON
182
- self.others = st.file_uploader("Traffic Acquisition (GA4) (CSV) - SEO", type='csv', key="seo5")
183
  if self.others:
184
  self.delete_sessions()
185
  try:
@@ -187,8 +187,8 @@ class Seo:
187
  except Exception:
188
  pass
189
 
190
- self.page_index = st.text_input("Pages Indexed:", placeholder='Enter Pages Indexed')
191
- self.bounce_rate = st.text_input("Bounce Rate:", placeholder='Enter Bounce Rate')
192
 
193
  followers = {
194
  'Pages Indexed': self.page_index if self.page_index else 'N/A',
@@ -291,8 +291,9 @@ class Seo:
291
  del st.session_state[df_seo]
292
  for others in st.session_state.keys():
293
  del st.session_state[others]
294
-
295
  st.session_state['analyzing'] = False
 
296
 
297
  if __name__ == "__main__":
298
  st.set_page_config(layout="wide")
 
159
  self.file_dict = upload.file_dict
160
  '''
161
  #st.write("") # FOR THE HIDE BUTTON
162
+ self.uploaded_file_seo = st.file_uploader("SEO Keywords - SEMRush", type='csv', key="seo2")
163
  if self.uploaded_file_seo:
164
  self.delete_sessions()
165
  try:
 
169
  pass
170
 
171
 
172
+ self.uploaded_file = st.file_uploader("Traffic Channels - SEMRush", type='csv')
173
  if self.uploaded_file:
174
  self.delete_sessions()
175
  try:
 
179
  pass
180
 
181
  st.write("") # FOR THE HIDE BUTTON
182
+ self.others = st.file_uploader("Traffic Acquisition - GA4", type='csv', key="seo5")
183
  if self.others:
184
  self.delete_sessions()
185
  try:
 
187
  except Exception:
188
  pass
189
 
190
+ self.page_index = st.text_input("Pages Indexed - Google Search Console:", placeholder='Enter Pages Indexed')
191
+ self.bounce_rate = st.text_input("Bounce Rate - GA4:", placeholder='Enter Bounce Rate')
192
 
193
  followers = {
194
  'Pages Indexed': self.page_index if self.page_index else 'N/A',
 
291
  del st.session_state[df_seo]
292
  for others in st.session_state.keys():
293
  del st.session_state[others]
294
+ print("done1")
295
  st.session_state['analyzing'] = False
296
+
297
 
298
  if __name__ == "__main__":
299
  st.set_page_config(layout="wide")
classes/Social_Media_FB.py CHANGED
@@ -68,11 +68,13 @@ class Facebook:
68
  "Best of Breed Solution": [str(backlink) for backlink in number_of_backlinks]
69
  }
70
  df_output = pd.DataFrame(data)
 
71
  with st.expander("AI Analysis", expanded=True, icon="πŸ€–"):
72
  st.table(df_output.style.set_table_styles(
73
  [{'selector': 'th:first-child, td:first-child', 'props': [('width', '20px')]},
74
  {'selector': 'th, td', 'props': [('width', '150px'), ('text-align', 'center')]}]
75
  ).set_properties(**{'text-align': 'center'}))
 
76
 
77
  return output
78
 
@@ -237,8 +239,8 @@ class Facebook:
237
 
238
  collect_telemetry(debug_info)
239
 
240
- with st.expander("Debug information", icon="βš™"):
241
- st.write(debug_info)
242
 
243
  for df in st.session_state.keys():
244
  del st.session_state[df]
@@ -248,7 +250,7 @@ class Facebook:
248
  st.session_state['analyzing'] = False
249
 
250
  except AttributeError:
251
- st.info("Please upload CSV or PDF files first.")
252
  hide_button()
253
 
254
  if __name__ == "__main__":
 
68
  "Best of Breed Solution": [str(backlink) for backlink in number_of_backlinks]
69
  }
70
  df_output = pd.DataFrame(data)
71
+ '''
72
  with st.expander("AI Analysis", expanded=True, icon="πŸ€–"):
73
  st.table(df_output.style.set_table_styles(
74
  [{'selector': 'th:first-child, td:first-child', 'props': [('width', '20px')]},
75
  {'selector': 'th, td', 'props': [('width', '150px'), ('text-align', 'center')]}]
76
  ).set_properties(**{'text-align': 'center'}))
77
+ '''
78
 
79
  return output
80
 
 
239
 
240
  collect_telemetry(debug_info)
241
 
242
+ #with st.expander("Debug information", icon="βš™"):
243
+ # st.write(debug_info)
244
 
245
  for df in st.session_state.keys():
246
  del st.session_state[df]
 
250
  st.session_state['analyzing'] = False
251
 
252
  except AttributeError:
253
+
254
  hide_button()
255
 
256
  if __name__ == "__main__":
classes/Social_Media_IG.py CHANGED
@@ -67,11 +67,13 @@ class Instagram:
67
  "Best of Breed Solution": [str(backlink) for backlink in number_of_backlinks]
68
  }
69
  df_output = pd.DataFrame(data)
 
70
  with st.expander("AI Analysis", expanded=True, icon="πŸ€–"):
71
  st.table(df_output.style.set_table_styles(
72
  [{'selector': 'th:first-child, td:first-child', 'props': [('width', '20px')]},
73
  {'selector': 'th, td', 'props': [('width', '150px'), ('text-align', 'center')]}]
74
  ).set_properties(**{'text-align': 'center'}))
 
75
 
76
  return output
77
 
@@ -123,7 +125,7 @@ class Instagram:
123
  if self.instagram or self.instagram_er or self.instagram_pf:
124
  try:
125
  combined_text = ""
126
- with st.spinner('Analyzing...', show_time=True):
127
  st.write('')
128
  try:
129
  combined_text += f"\nInstagram Followers: {self.instagram}"
@@ -154,7 +156,7 @@ class Instagram:
154
  for facebook_ad_campaign in st.session_state.keys():
155
  del st.session_state[facebook_ad_campaign]
156
 
157
- st.session_state['analyzing'] = False
158
  except AttributeError:
159
  st.info("Please upload CSV or PDF files first.")
160
  hide_button()
 
67
  "Best of Breed Solution": [str(backlink) for backlink in number_of_backlinks]
68
  }
69
  df_output = pd.DataFrame(data)
70
+ '''
71
  with st.expander("AI Analysis", expanded=True, icon="πŸ€–"):
72
  st.table(df_output.style.set_table_styles(
73
  [{'selector': 'th:first-child, td:first-child', 'props': [('width', '20px')]},
74
  {'selector': 'th, td', 'props': [('width', '150px'), ('text-align', 'center')]}]
75
  ).set_properties(**{'text-align': 'center'}))
76
+ '''
77
 
78
  return output
79
 
 
125
  if self.instagram or self.instagram_er or self.instagram_pf:
126
  try:
127
  combined_text = ""
128
+ with st.spinner('Instagram...', show_time=True):
129
  st.write('')
130
  try:
131
  combined_text += f"\nInstagram Followers: {self.instagram}"
 
156
  for facebook_ad_campaign in st.session_state.keys():
157
  del st.session_state[facebook_ad_campaign]
158
 
159
+
160
  except AttributeError:
161
  st.info("Please upload CSV or PDF files first.")
162
  hide_button()
pages/home.py CHANGED
@@ -19,7 +19,7 @@ st.write("# Digital Footprint AI Team")
19
  if 'nature' not in st.session_state:
20
  st.session_state['nature'] = ''
21
  if 'analyze' not in st.session_state:
22
- st.session_state['analyze'] = ''
23
 
24
  def row1():
25
  col1, col2, col3, col4 = st.columns(4, border=True, gap="medium", vertical_alignment="top")
@@ -29,11 +29,17 @@ def row1():
29
  f"{st.session_state.nature}",help="Name of business, nature of business, location, products/services"
30
  )
31
  st.session_state.nature = txt
 
 
32
 
 
 
 
 
33
  with col2:
34
  st.write("## Website Traffic")
35
  backlinks = SeoOffPageAnalyst(os.getenv('MODEL_Off_Page_Analyst'))
36
- backlinks = SeoBacklinks(os.getenv('MODEL_SEO_Analyst'))
37
  keywords = Seo(os.getenv('MODEL_SEO_Analyst'))
38
 
39
  with col3:
@@ -57,25 +63,12 @@ def row1():
57
  tiktok = Tiktok(os.getenv('MODEL_Social_Media_Analyst'))
58
 
59
  with col4:
60
- st.write("## Website Performance")
61
  crawl = SeoOnCrawl(os.getenv('MODEL_On_Page_Analyst'))
62
  gtmetrix = SeoOnGT(os.getenv('MODEL_On_Page_Analyst'))
63
 
64
 
65
  return col1, col2, col3, col4
66
 
67
- def row2():
68
- col1, col2, col3 = st.columns( gap="medium", spec=[0.73, 0.8, 0.03])
69
-
70
- with col2:
71
- if 'analyze' not in st.session_state:
72
- st.session_state['analyze'] = ''
73
-
74
- analyze_button = st.button("Analyze", st.session_state['analyze'])
75
- if analyze_button:
76
- st.session_state['analyze'] = 'clicked'
77
-
78
- return col1, col2, col3
79
-
80
  row1()
81
- row2()
 
19
  if 'nature' not in st.session_state:
20
  st.session_state['nature'] = ''
21
  if 'analyze' not in st.session_state:
22
+ st.session_state['analyze'] = False
23
 
24
  def row1():
25
  col1, col2, col3, col4 = st.columns(4, border=True, gap="medium", vertical_alignment="top")
 
29
  f"{st.session_state.nature}",help="Name of business, nature of business, location, products/services"
30
  )
31
  st.session_state.nature = txt
32
+ if 'analyze' not in st.session_state:
33
+ st.session_state['analyze'] = False
34
 
35
+ analyze_button = st.button("Analyze", st.session_state['analyze'])
36
+ if analyze_button:
37
+ st.session_state['analyze'] = 'clicked'
38
+
39
  with col2:
40
  st.write("## Website Traffic")
41
  backlinks = SeoOffPageAnalyst(os.getenv('MODEL_Off_Page_Analyst'))
42
+ #backlinks = SeoBacklinks(os.getenv('MODEL_SEO_Analyst'))
43
  keywords = Seo(os.getenv('MODEL_SEO_Analyst'))
44
 
45
  with col3:
 
63
  tiktok = Tiktok(os.getenv('MODEL_Social_Media_Analyst'))
64
 
65
  with col4:
66
+ st.write("## Website Structure")
67
  crawl = SeoOnCrawl(os.getenv('MODEL_On_Page_Analyst'))
68
  gtmetrix = SeoOnGT(os.getenv('MODEL_On_Page_Analyst'))
69
 
70
 
71
  return col1, col2, col3, col4
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  row1()
74
+