Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- clients.py +16 -13
- pages/Apollo_Extract.py +1 -3
- pages/Business_Hubs.py +1 -29
clients.py
CHANGED
@@ -9,8 +9,20 @@ import os
|
|
9 |
import streamlit as st
|
10 |
import pandas as pd
|
11 |
import requests
|
|
|
12 |
import os
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
def add_https_to_urls(df, column_name):
|
16 |
"""
|
@@ -40,15 +52,6 @@ def add_https_to_urls(df, column_name):
|
|
40 |
df[column_name] = df[column_name].apply(correct_protocol)
|
41 |
return df
|
42 |
|
43 |
-
|
44 |
-
host=os.getenv("backend")
|
45 |
-
|
46 |
-
CompanyBackendService=host+'/receive_companies/'
|
47 |
-
UserBackendService=host+'/receive_users/'
|
48 |
-
BothFeaturesService=host+'/receive_data/'
|
49 |
-
NGOEmailsService=host+'/receive_ngo_emails/'
|
50 |
-
IndustryEmailService=host+'/receive_industry_email/'
|
51 |
-
|
52 |
def CompanySpecificClient(email_receiver):
|
53 |
input_data_companies = None
|
54 |
submitted_companies = False
|
@@ -127,7 +130,7 @@ def CompanySpecificClient(email_receiver):
|
|
127 |
csv = df.to_csv(index=False)
|
128 |
|
129 |
# Construct the data to send
|
130 |
-
data_to_send = {"prompt_notes": prompt_notes, "dataframe": csv,"email_receiver":email_receiver}
|
131 |
|
132 |
# Sending the POST request to FastAPI
|
133 |
response = requests.post(CompanyBackendService, json=data_to_send)
|
@@ -213,7 +216,7 @@ def UserSpecificClient(email_receiver):
|
|
213 |
|
214 |
# Construct the data to send
|
215 |
|
216 |
-
data_to_send = {"dataframe": csv, "email_receiver": email_receiver,"email_template":"False"}
|
217 |
|
218 |
# Sending the POST request to FastAPI
|
219 |
response = requests.post(UserBackendService, json=data_to_send)
|
@@ -306,7 +309,7 @@ def bothFeaturesFunction(email_receiver):
|
|
306 |
csv = df.to_csv(index=False)
|
307 |
|
308 |
# Construct the data to send
|
309 |
-
data_to_send = {"prompt_notes": prompt_notes, "dataframe": csv,"email_receiver":email_receiver}
|
310 |
|
311 |
# Sending the POST request to FastAPI
|
312 |
response = requests.post(BothFeaturesService, json=data_to_send)
|
|
|
9 |
import streamlit as st
|
10 |
import pandas as pd
|
11 |
import requests
|
12 |
+
from dotenv import load_dotenv
|
13 |
import os
|
14 |
+
|
15 |
+
# Load environment variables from .env file
|
16 |
+
load_dotenv()
|
17 |
+
|
18 |
+
host=os.getenv("Host")
|
19 |
+
|
20 |
+
CompanyBackendService=host+'/receive_companies/'
|
21 |
+
UserBackendService=host+'/receive_users/'
|
22 |
+
BothFeaturesService=host+'/receive_data/'
|
23 |
+
NGOEmailsService=host+'/receive_ngo_emails/'
|
24 |
+
IndustryEmailService=host+'/receive_industry_email/'
|
25 |
+
|
26 |
|
27 |
def add_https_to_urls(df, column_name):
|
28 |
"""
|
|
|
52 |
df[column_name] = df[column_name].apply(correct_protocol)
|
53 |
return df
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
def CompanySpecificClient(email_receiver):
|
56 |
input_data_companies = None
|
57 |
submitted_companies = False
|
|
|
130 |
csv = df.to_csv(index=False)
|
131 |
|
132 |
# Construct the data to send
|
133 |
+
data_to_send = {"prompt_notes": prompt_notes, "dataframe": csv,"email_receiver":email_receiver,"filename": uploaded_file.name}
|
134 |
|
135 |
# Sending the POST request to FastAPI
|
136 |
response = requests.post(CompanyBackendService, json=data_to_send)
|
|
|
216 |
|
217 |
# Construct the data to send
|
218 |
|
219 |
+
data_to_send = {"dataframe": csv, "email_receiver": email_receiver,"email_template":"False","filename": uploaded_file.name}
|
220 |
|
221 |
# Sending the POST request to FastAPI
|
222 |
response = requests.post(UserBackendService, json=data_to_send)
|
|
|
309 |
csv = df.to_csv(index=False)
|
310 |
|
311 |
# Construct the data to send
|
312 |
+
data_to_send = {"prompt_notes": prompt_notes, "dataframe": csv,"email_receiver":email_receiver,"filename": uploaded_file.name}
|
313 |
|
314 |
# Sending the POST request to FastAPI
|
315 |
response = requests.post(BothFeaturesService, json=data_to_send)
|
pages/Apollo_Extract.py
CHANGED
@@ -16,9 +16,7 @@ def main():
|
|
16 | |
17 | |
18 | |
19 |
-
"[email protected]"
|
20 |
-
"[email protected]",
|
21 | |
22 |
]
|
23 |
email_receiver = st.selectbox("Please select an email address", email_options)
|
24 |
|
|
|
16 | |
17 | |
18 | |
19 | |
|
|
|
|
20 |
]
|
21 |
email_receiver = st.selectbox("Please select an email address", email_options)
|
22 |
|
pages/Business_Hubs.py
CHANGED
@@ -22,37 +22,9 @@ def main():
|
|
22 |
"[email protected]": "Paulina",
|
23 |
"[email protected]": "Fabio",
|
24 |
"[email protected]": "Rudradeb",
|
25 |
-
"[email protected]": "Mohanad"
|
26 |
-
"[email protected]": "Huzefa",
|
27 |
-
"[email protected]": "Mustafa",
|
28 |
-
"[email protected]": "Mike",
|
29 |
-
"[email protected]": "Ansh",
|
30 |
-
"[email protected]": "Jamaludeen",
|
31 |
-
"[email protected]": "Mohammed Zuhair",
|
32 |
-
"[email protected]": "Shawna",
|
33 |
-
"[email protected]": "Peter",
|
34 |
-
"[email protected]": "Derek",
|
35 |
-
"[email protected]": "Allan",
|
36 |
-
"[email protected]": "Miguel",
|
37 |
-
"[email protected]": "Cristian",
|
38 |
-
"[email protected]": "Vamsi Krishna",
|
39 |
-
"[email protected]": "Manifest",
|
40 |
-
"[email protected]": "Utkarsha",
|
41 |
-
"[email protected]": "Emmanuel",
|
42 |
-
"[email protected]": "Damian",
|
43 |
-
"[email protected]": "Humberto",
|
44 |
-
"[email protected]": "Nafsika",
|
45 |
-
"[email protected]": "Madalin",
|
46 |
-
"[email protected]": "William",
|
47 |
-
"[email protected]": "Adish",
|
48 |
-
"[email protected]": "John",
|
49 |
-
"[email protected]": "Dmytro",
|
50 |
-
"[email protected]": "Levent",
|
51 |
-
"[email protected]": "Joao",
|
52 |
-
"[email protected]": "Lior"
|
53 |
}
|
54 |
|
55 |
-
|
56 |
with st.form(key='my_form'):
|
57 |
options = ["NGO Emails", "Industry company focused Emails"]
|
58 |
selected_options = st.selectbox("Please select the needed features", options,key='select feature')
|
|
|
22 |
"[email protected]": "Paulina",
|
23 |
"[email protected]": "Fabio",
|
24 |
"[email protected]": "Rudradeb",
|
25 |
+
"[email protected]": "Mohanad"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
|
|
|
28 |
with st.form(key='my_form'):
|
29 |
options = ["NGO Emails", "Industry company focused Emails"]
|
30 |
selected_options = st.selectbox("Please select the needed features", options,key='select feature')
|