forestav commited on
Commit
77c06a9
·
1 Parent(s): f19244a

update styling

Browse files
Files changed (1) hide show
  1. app.py +60 -21
app.py CHANGED
@@ -7,6 +7,8 @@ import re
7
  from pinecone_handler import PineconeHandler
8
  from time_handling import read_timestamp
9
  from datetime import datetime
 
 
10
 
11
  def extract_text_from_pdf(pdf_file) -> str:
12
  """Extract text content from PDF file"""
@@ -103,17 +105,60 @@ def format_job_description(description: str, truncated: bool = False) -> str:
103
 
104
 
105
  def main():
106
- st.title("Resume-Based Job Search")
107
-
108
- # Add last update time display
109
- try:
110
- last_update = read_timestamp()
111
- last_update_dt = datetime.strptime(last_update, "%Y-%m-%d %H:%M:%S")
112
- st.markdown(f"*Last database update: {last_update_dt.strftime('%B %d, %Y at %I:%M %p')}*")
113
- except Exception as e:
114
- st.warning("Unable to retrieve last update time")
115
-
116
- st.write("Upload your resume to find matching job opportunities")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
  # Initialize PineconeHandler
119
  try:
@@ -159,15 +204,14 @@ def main():
159
  with col1:
160
  st.markdown(f"### {metadata['headline']}")
161
  with col2:
162
- st.markdown(f"**Match Score:** {score:.2f}")
163
 
164
  # Job details section
165
- st.markdown(f"**Company:** {metadata.get('company', 'Not specified')}")
 
166
  st.markdown(f"**Location:** {metadata['city']}")
167
  st.markdown(f"**Occupation:** {metadata['occupation']}")
168
  st.markdown(f"**Published:** {metadata['published']}")
169
- if metadata.get('logo_url'):
170
- st.image(metadata['logo_url'], width=100)
171
 
172
  # Check if description is truncated
173
  description = metadata['description']
@@ -186,16 +230,11 @@ def main():
186
  # Try to fetch full description from webpage_url
187
  st.markdown("""
188
  **Note:** The full description has been truncated in our database.
189
- Please visit the original job posting for complete details.
190
  """)
191
  if metadata.get('webpage_url'):
192
  st.markdown(f"[View Original Job Posting]({metadata['webpage_url']})")
193
 
194
- # Application section
195
- st.markdown("### How to Apply")
196
- if metadata.get('webpage_url'):
197
- st.markdown(f"[Apply Online]({metadata['webpage_url']})")
198
- if metadata.get('email'):
199
  st.markdown(f"📧 Contact: {metadata['email']}")
200
 
201
  st.markdown("---")
 
7
  from pinecone_handler import PineconeHandler
8
  from time_handling import read_timestamp
9
  from datetime import datetime
10
+ import os
11
+ from settings import DATE_FORMAT
12
 
13
  def extract_text_from_pdf(pdf_file) -> str:
14
  """Extract text content from PDF file"""
 
105
 
106
 
107
  def main():
108
+ # Add custom CSS
109
+ st.markdown("""
110
+ <style>
111
+ .big-font {
112
+ font-size: 24px !important;
113
+ font-weight: bold;
114
+ color: #1E3A8A;
115
+ }
116
+ .update-info {
117
+ padding: 10px;
118
+ background-color: #F3F4F6;
119
+ border-radius: 5px;
120
+ margin: 10px 0;
121
+ font-size: 14px;
122
+ color: #4B5563;
123
+ }
124
+ .step {
125
+ margin: 10px 0;
126
+ padding: 10px;
127
+ background-color: white;
128
+ border-radius: 5px;
129
+ border: 1px solid #E5E7EB;
130
+ }
131
+ </style>
132
+ """, unsafe_allow_html=True)
133
+
134
+ # Main content
135
+ st.markdown('<p class="big-font">AI-Powered Job Search</p>', unsafe_allow_html=True)
136
+ st.markdown("""
137
+ 💼 **Transform Your Job Search with AI**
138
+
139
+ Tired of searching for jobs? Let AI do the work for you! Upload your resume and discover
140
+ perfectly matched opportunities in minutes - not hours!
141
+ """)
142
+
143
+ # Sidebar content
144
+ with st.sidebar:
145
+ st.markdown("### How It Works")
146
+ st.markdown("1. **Upload Resume**\n PDF, DOCX, DOC, or TXT formats")
147
+ st.markdown("2. **Extract Content**\n AI processes your resume")
148
+ st.markdown("3. **Smart Search**\n Match against our database")
149
+ st.markdown("4. **Get Matches**\n View personalized recommendations")
150
+
151
+ st.markdown("---") # Divider
152
+
153
+ # Database update info
154
+ try:
155
+ last_update = read_timestamp()
156
+ last_update_dt = datetime.strptime(last_update, DATE_FORMAT)
157
+ st.markdown("### Database Status")
158
+ st.markdown("🔄 Updates every 6 hours")
159
+ st.markdown(f"**Last update:**{last_update_dt.strftime('%B %d, %Y at %I:%M %p')}")
160
+ except Exception as e:
161
+ st.error(f"Error reading timestamp: {str(e)}")
162
 
163
  # Initialize PineconeHandler
164
  try:
 
204
  with col1:
205
  st.markdown(f"### {metadata['headline']}")
206
  with col2:
207
+ st.markdown(f"**Match Score (Cosine):** {score:.2f}")
208
 
209
  # Job details section
210
+ if metadata.get('logo_url'):
211
+ st.image(metadata['logo_url'], width=100)
212
  st.markdown(f"**Location:** {metadata['city']}")
213
  st.markdown(f"**Occupation:** {metadata['occupation']}")
214
  st.markdown(f"**Published:** {metadata['published']}")
 
 
215
 
216
  # Check if description is truncated
217
  description = metadata['description']
 
230
  # Try to fetch full description from webpage_url
231
  st.markdown("""
232
  **Note:** The full description has been truncated in our database.
233
+ Please visit the original job posting for complete details and for searching the job.
234
  """)
235
  if metadata.get('webpage_url'):
236
  st.markdown(f"[View Original Job Posting]({metadata['webpage_url']})")
237
 
 
 
 
 
 
238
  st.markdown(f"📧 Contact: {metadata['email']}")
239
 
240
  st.markdown("---")