MohanadAfiffy commited on
Commit
986895c
·
verified ·
1 Parent(s): 2997b5a

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +160 -148
  2. pages/Apollo_Extract.py +75 -0
  3. pages/Business_Hubs.py +89 -0
app.py CHANGED
@@ -1,153 +1,165 @@
 
 
1
  import streamlit as st
2
- st.write("Maintenance notice to release the new version that support business hubs")
3
- # import streamlit as st
4
- # import pandas as pd
5
- # import requests
6
- # import os
7
-
8
- # def main():
9
-
10
- # BackendService=os.getenv("backend")
11
- # input_data=None
12
- # submitted=None
13
- # # Wrap everything inside a form
14
- # with st.sidebar:
15
-
16
- # uploaded_file = st.file_uploader("Kindly upload a CSV file that includes the names and websites of the companies", type=["csv"])
17
- # opt_out_scraping = st.checkbox("Opt out of scraping")
18
- # if uploaded_file is not None:
19
- # try:
20
- # # Detect file type and read accordingly
21
- # file_type = uploaded_file.name.split('.')[-1]
22
- # if file_type == 'csv':
23
- # df = pd.read_csv(uploaded_file)
24
- # elif file_type == 'xlsx':
25
- # df = pd.read_excel(uploaded_file)
26
-
27
- # # Limiting the dataframe for processing
28
-
29
- # # Check if 'Website' column exists
30
- # if 'Website' not in df.columns:
31
- # all_columns = df.columns.tolist()
32
- # website_column = st.selectbox("Select the column for Website:", all_columns)
33
- # else:
34
- # website_column = 'Website'
35
-
36
-
37
- # # Check if 'Company Name for Emails' column exists
38
- # if 'Company Name for Emails' not in df.columns:
39
- # all_columns = df.columns.tolist()
40
- # company_column= st.selectbox("Select the column for Company Name for Emails:", all_columns)
41
- # else:
42
- # company_column = 'Company Name for Emails'
43
-
44
- # if opt_out_scraping:
45
- # if 'Description' not in df.columns:
46
- # all_columns = df.columns.tolist()
47
- # description_column = st.selectbox("Select the column for Description:", all_columns)
48
- # df.rename(columns={description_column: 'scraped_content'}, inplace=True)
49
- # else:
50
- # df.rename(columns={'Description': 'scraped_content'}, inplace=True)
51
-
52
- # input_data=df
53
-
54
- # except Exception as E :
55
- # st.error("An error occured while processing the file")
56
-
57
- # with st.form(key='my_form'):
58
- # # Fetch the filtered data
59
- # prompt_notes= st.text_input("If applicable please mention the network name")
60
-
61
- # # List of predefined email addresses
62
- # email_options = [
63
64
65
66
67
68
69
70
- # ]
71
-
72
- # # Streamlit select box for choosing an email
73
- # email_receiver = st.selectbox("Please select an email address", email_options)
74
-
75
 
76
- # # If the button is clicked, it will return True for this run
77
- # button_clicked = st.form_submit_button("Submit")
78
-
79
- # # 2. Update session state for the button
80
- # if button_clicked:
81
- # submitted = True
82
- # # Set the session state to the new value
83
- # prompt_notes = prompt_notes
84
- # # 3. Use the session state variable to determine if the button was previously clicked
85
- # if submitted and input_data is not None:
86
- # df = input_data
87
- # if not opt_out_scraping:
88
- # df[website_column] = df[website_column].astype(str)
89
- # df=df[[website_column,company_column]]
90
- # df.columns = ["Website","Company Name for Emails"]
91
- # df = df.drop_duplicates(subset="Website", keep='first')
92
- # df = df.dropna().loc[~(df == '').all(axis=1)]
93
- # else:
94
- # df[website_column] = df[website_column].astype(str)
95
- # df=df[[website_column,company_column,"scraped_content"]]
96
- # df.columns = ["Website","Company Name for Emails","scraped_content"]
97
- # df = df.drop_duplicates(subset="Website", keep='first')
98
- # df = df.dropna().loc[~(df == '').all(axis=1)]
99
-
100
-
101
- # st.write(df)
102
- # # Convert DataFrame to CSV for transmission
103
- # csv = df.to_csv(index=False)
104
-
105
- # # Construct the data to send
106
- # data_to_send = {"prompt_notes": prompt_notes, "dataframe": csv,"email_receiver":email_receiver}
107
-
108
- # # Sending the POST request to FastAPI
109
- # response = requests.post(BackendService, json=data_to_send)
110
-
111
- # if response.status_code == 200:
112
- # st.info(f"We're processing your request. You can close the app now. An email will be sent to {email_receiver} once the process is finished.")
113
- # else:
114
- # st.error("Data transmission failed. Please verify that your file contains the labels 'Company Website' and 'Company Name'. Additionally, ensure that your file is valid and contains records and try again , if the problem persists please contact us at [email protected]")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- # if __name__ == "__main__":
118
- # st.markdown(
119
- # """
120
- # <style>
121
- # .higher-title {
122
- # font-size:35px !important;
123
- # color: #4A90E2; /* Shade of blue */
124
- # text-align: center;
125
- # font-weight: bold;
126
- # margin-top: -20px; /* Adjust this value to control the height */
127
- # }
128
- # </style>
129
- # """,
130
- # unsafe_allow_html=True,
131
- # )
132
-
133
- # st.markdown('<p class="higher-title">SalesIntel AI</p>', unsafe_allow_html=True)
134
-
135
-
136
-
137
- # logo_url = "https://i.imgur.com/WYnv26e.jpeg" # Replace this with your image's direct URL
138
- # st.markdown(
139
- # f"""
140
- # <style>
141
- # .logo {{
142
- # position: fixed;
143
- # bottom: 5px;
144
- # right: 5px;
145
- # width: 100px; # Adjust width as needed
146
- # }}
147
- # </style>
148
- # <img src="{logo_url}" class="logo">
149
- # """,
150
- # unsafe_allow_html=True,
151
- # )
152
- # main()
153
 
 
1
+
2
+
3
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ st.markdown(
6
+ """
7
+ <style>
8
+ .higher-title {
9
+ font-size:35px !important;
10
+ color: #4A90E2; /* Shade of blue */
11
+ text-align: center;
12
+ font-weight: bold;
13
+ margin-top: -20px; /* Adjust this value to control the height */
14
+ }
15
+ </style>
16
+ """,
17
+ unsafe_allow_html=True,
18
+ )
19
+
20
+ st.markdown('<p class="higher-title">SalesIntel AI</p>', unsafe_allow_html=True)
21
+
22
+ st.markdown("""
23
+
24
+ <h2 style="color:blue;">Business Hubs</h2>
25
+ <h3 style="color:green;">Generate Emails - NGO Oriented Function 🌍</h3>
26
+
27
+ <h4>Generates personalized Emails for NGO campaigns, you have two options to use it</h4>
28
+
29
+ <h4 style="color:orange;">With Scraping:</h4>
30
+
31
+ <h6>Best for Mass Emails with minimal initial data.</h6>
32
+
33
+ <h3 style="color:purple;">Required Columns:</h3>
34
+ <ul>
35
+ <li><strong>👤 First Name</strong></li>
36
+ <li><strong>🏢 Company Name</strong></li>
37
+ <li><strong>🌐 Domain</strong></li>
38
+ <li><strong>📌 Title</strong></li>
39
+ <li><strong>🔗 Person LinkedIn URL</strong></li>
40
+ <li><strong>🔗 Company website</strong></li>
41
+ <li><strong>👤 Email</strong></li>
42
+ </ul>
43
+
44
+ <h4 style="color:orange;">Opt-Out of Scraping:</h4>
45
+
46
+ <h6>Best for Low Volume Emails, Perfect for detailed information and targeted approach.</h6>
47
+
48
+ <h4 style="color:purple;">Required Columns:</h4>
49
+ <ul>
50
+ <li><strong>👤 First Name</strong></li>
51
+ <li><strong>🏢 Company Name</strong></li>
52
+ <li><strong>🌐 Domain</strong></li>
53
+ <li><strong>📝 User Description</strong></li>
54
+ <li><strong>👤 Email</strong></li>
55
+ </ul>
56
+
57
+ <h3 style="color:green;">🏢 Generate Emails for Industries/Startups</h3>
58
+
59
+ <h4>Supports personalized email generation for specific industries or startups, you have two options to use it</h4>
60
+
61
+ <h4 style="color:orange;">With Scraping:</h4>
62
+ <h6>For comprehensive company info with limited initial data.</h6>
63
+
64
+ <h3 style="color:purple;">Required Columns:</h3>
65
+ <ul>
66
+ <li><strong>🔗 Website</strong></li>
67
+ <li><strong>🏢 Company Name</strong></li>
68
+ <li><strong>👤 First Name</strong></li>
69
+ <li><strong>👤 Email</strong></li>
70
+ </ul>
71
+
72
+ <h4 style="color:orange;">Opt-Out of Scraping:</h4>
73
+ <h6>For complete company descriptions at hand.</h6>
74
+
75
+ <h4 style="color:purple;">Required Columns:</h4>
76
+ <ul>
77
+ <li><strong>🔗 Website</strong></li>
78
+ <li><strong>🏢 Company Name</strong></li>
79
+ <li><strong>👤 First Name</strong></li>
80
+ <li><strong>📝 Company Description</strong></li>
81
+ <li><strong>👤 Email</strong></li>
82
+ </ul>
83
+
84
+
85
+
86
 
87
+ """,unsafe_allow_html=True)
88
+
89
+ st.markdown("-----------------------------------------------------")
90
+
91
+
92
+ st.markdown("""
93
+ <h2 style='color: navy;'>Sales Core team - Apollo -</h2>
94
+ <h3 style='color: darkgreen;'>Data Processing Functions</h3>
95
+
96
+ <h4 style='color: teal;'>Company-Specific Client Function</h4>
97
+ <p>Upload a CSV with company names and websites.</p>
98
+ <ul>
99
+ <li><strong>With Scraping:</strong>
100
+ <ul>
101
+ <li>Required: <code>Website</code>, <code>Company Name for Emails</code></li>
102
+ <li>The tool scrapes for extra company information.</li>
103
+ </ul>
104
+ </li>
105
+ <li><strong>Opt Out:</strong>
106
+ <ul>
107
+ <li>Required: <code>Website</code>, <code>Company Name for Emails</code>, <code>Company Description</code> (used as <code>scraped_content</code>)</li>
108
+ <li>Provide your own company descriptions; no scraping.</li>
109
+ </ul>
110
+ </li>
111
+ </ul>
112
+
113
+ <h4 style='color: teal;'>User-Specific Client Function</h4>
114
+ <p>Upload a CSV with personal and company information.</p>
115
+ <ul>
116
+ <li><strong>With Scraping:</strong>
117
+ <ul>
118
+ <li>Required: <code>First Name</code>, <code>Company Name for Emails</code>, <code>Title</code>, <code>Website</code>, <code>Last Name</code>, <code>Person Linkedin Url</code>,<code>Email</code></li>
119
+ <li>The tool scrapes LinkedIn and other sources for additional information.</li>
120
+ </ul>
121
+ </li>
122
+ <li><strong>Opt Out:</strong>
123
+ <ul>
124
+ <li>Required: <code>First Name</code>, <code>Company Name for Emails</code>, <code>Person Linkedin Url</code>, <code>User Description</code> (used as <code>Scrapped Profile</code>),<code>Email</code></li>
125
+ <li>Use your data without scraping additional information.</li>
126
+ </ul>
127
+ </li>
128
+ </ul>
129
+
130
+ <h4 style='color: teal;'>Both Features Function</h4>
131
+ <p>Combine user and company-specific data processing.</p>
132
+ <ul>
133
+ <li><strong>With Scraping:</strong>
134
+ <ul>
135
+ <li>Required: <code>First Name</code>, <code>Company Name for Emails</code>, <code>Title</code>, <code>Last Name</code>, <code>Person Linkedin Url</code>, <code>Website</code>,<code>Email</code></li>
136
+ <li>Scrapes for comprehensive data on both individuals and companies.</li>
137
+ </ul>
138
+ </li>
139
+ <li><strong>Opt Out:</strong>
140
+ <ul>
141
+ <li>Required: <code>First Name</code>, <code>Company Name for Emails</code>, <code>Person Linkedin Url</code>, <code>Company Description</code> (used as <code>scraped_content</code>), <code>User Description</code> (used as <code>Scrapped Profile</code>),<code>Email</code></li>
142
+ <li>Rely on user-provided descriptions for both individuals and companies.</li>
143
+ </ul>
144
+ </li>
145
+ </ul>
146
+ """, unsafe_allow_html=True)
147
+
148
+
149
 
150
+ logo_url = "https://i.imgur.com/WYnv26e.jpeg" # Replace this with your image's direct URL
151
+ st.markdown(
152
+ f"""
153
+ <style>
154
+ .logo {{
155
+ position: fixed;
156
+ bottom: 5px;
157
+ right: 5px;
158
+ width: 100px; # Adjust width as needed
159
+ }}
160
+ </style>
161
+ <img src="{logo_url}" class="logo">
162
+ """,
163
+ unsafe_allow_html=True,
164
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
pages/Apollo_Extract.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from clients import CompanySpecificClient,UserSpecificClient,bothFeaturesFunction
3
+
4
+ def main():
5
+ # Start of the form
6
+ if 'form_submitted' not in st.session_state:
7
+ st.session_state['form_submitted'] = False
8
+ with st.form(key='my_form'):
9
+ options = ["Company-Specific Email Outreach", "Leadership Email Customization"]
10
+ selected_options = st.multiselect("Please select the needed features", options)
11
+
12
+ email_options = [
13
14
15
16
17
18
19
20
+ ]
21
+ email_receiver = st.selectbox("Please select an email address", email_options)
22
+
23
+ # Submit button for the form
24
+ submit_button = st.form_submit_button(label='Select features')
25
+
26
+ # Check if the form has been submitted
27
+ if submit_button:
28
+ st.session_state['form_submitted'] = True
29
+ if st.session_state['form_submitted']:
30
+ if "Company-Specific Email Outreach" in selected_options and "Leadership Email Customization" in selected_options:
31
+ bothFeaturesFunction(email_receiver)
32
+ elif "Company-Specific Email Outreach" in selected_options :
33
+ CompanySpecificClient(email_receiver)
34
+ elif "Leadership Email Customization" in selected_options :
35
+ UserSpecificClient(email_receiver)
36
+
37
+
38
+
39
+ if __name__ == "__main__":
40
+ st.markdown(
41
+ """
42
+ <style>
43
+ .higher-title {
44
+ font-size:35px !important;
45
+ color: #4A90E2; /* Shade of blue */
46
+ text-align: center;
47
+ font-weight: bold;
48
+ margin-top: -20px; /* Adjust this value to control the height */
49
+ }
50
+ </style>
51
+ """,
52
+ unsafe_allow_html=True,
53
+ )
54
+
55
+ st.markdown('<p class="higher-title">SalesIntel AI</p>', unsafe_allow_html=True)
56
+
57
+
58
+
59
+ logo_url = "https://i.imgur.com/WYnv26e.jpeg" # Replace this with your image's direct URL
60
+ st.markdown(
61
+ f"""
62
+ <style>
63
+ .logo {{
64
+ position: fixed;
65
+ bottom: 5px;
66
+ right: 5px;
67
+ width: 100px; # Adjust width as needed
68
+ }}
69
+ </style>
70
+ <img src="{logo_url}" class="logo">
71
+ """,
72
+ unsafe_allow_html=True,
73
+ )
74
+ main()
75
+
pages/Business_Hubs.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Created on Tue Jan 2 12:26:26 2024
5
+
6
+ @author: mohanadafiffy
7
+ """
8
+
9
+ import streamlit as st
10
+ from clients import BH_Ngo ,BH_industry
11
+
12
+ def main():
13
+ # Start of the form
14
+ if 'form_submitted' not in st.session_state:
15
+ st.session_state['form_submitted'] = False
16
+
17
+ # Dictionary mapping emails to sender names
18
+ email_to_sender = {
19
+ "[email protected]": "Michael",
20
+ "[email protected]": "James",
21
+ "[email protected]": "Weronika",
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')
31
+
32
+ email_options = list(email_to_sender.keys())
33
+ email_receiver = st.selectbox("Please select an email address", email_options)
34
+
35
+ # Display the sender name based on the selected email
36
+ sender_name = email_to_sender.get(email_receiver, " ")
37
+
38
+ # Submit button for the form
39
+ calendly_link = st.text_input("Please write your Calendly link")
40
+ submit_button = st.form_submit_button(label='Select features')
41
+
42
+ # Check if the form has been submitted
43
+ if submit_button:
44
+ st.session_state['form_submitted'] = True
45
+ if st.session_state['form_submitted']:
46
+ if "NGO Emails" in selected_options :
47
+ BH_Ngo(email_receiver,calendly_link,sender_name)
48
+ elif "Industry company focused Emails" in selected_options :
49
+ BH_industry(email_receiver,calendly_link,sender_name)
50
+
51
+
52
+
53
+ if __name__ == "__main__":
54
+ st.markdown(
55
+ """
56
+ <style>
57
+ .higher-title {
58
+ font-size:35px !important;
59
+ color: #4A90E2; /* Shade of blue */
60
+ text-align: center;
61
+ font-weight: bold;
62
+ margin-top: -20px; /* Adjust this value to control the height */
63
+ }
64
+ </style>
65
+ """,
66
+ unsafe_allow_html=True,
67
+ )
68
+
69
+ st.markdown('<p class="higher-title">SalesIntel AI</p>', unsafe_allow_html=True)
70
+
71
+
72
+
73
+ logo_url = "https://i.imgur.com/WYnv26e.jpeg" # Replace this with your image's direct URL
74
+ st.markdown(
75
+ f"""
76
+ <style>
77
+ .logo {{
78
+ position: fixed;
79
+ bottom: 5px;
80
+ right: 5px;
81
+ width: 100px; # Adjust width as needed
82
+ }}
83
+ </style>
84
+ <img src="{logo_url}" class="logo">
85
+ """,
86
+ unsafe_allow_html=True,
87
+ )
88
+ main()
89
+