Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1 +1,37 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from utils.parser import parse_cv, extract_education_level, identify_cv_type
|
| 3 |
+
from utils.cv_scoring import calculate_cv_score
|
| 4 |
+
from utils.suggestions import (
|
| 5 |
+
get_certification_suggestions,
|
| 6 |
+
get_higher_education_suggestions,
|
| 7 |
+
get_visa_recommendations,
|
| 8 |
+
get_career_advice,
|
| 9 |
+
get_job_listings,
|
| 10 |
+
)
|
| 11 |
+
import base64
|
| 12 |
+
import io
|
| 13 |
+
import datetime
|
| 14 |
+
|
| 15 |
+
st.title("Universal Smart CV Analyzer & Career Roadmap")
|
| 16 |
+
|
| 17 |
+
uploaded_file = st.file_uploader("Upload your CV in PDF format", type=["pdf"])
|
| 18 |
+
|
| 19 |
+
if uploaded_file is not None:
|
| 20 |
+
# Save uploaded file temporarily
|
| 21 |
+
with open("temp_cv.pdf", "wb") as f:
|
| 22 |
+
f.write(uploaded_file.getbuffer())
|
| 23 |
+
|
| 24 |
+
# Parse CV
|
| 25 |
+
parsed_text = parse_cv("temp_cv.pdf")
|
| 26 |
+
education_level = extract_education_level(parsed_text)
|
| 27 |
+
cv_type = identify_cv_type(parsed_text)
|
| 28 |
+
score, score_breakdown = calculate_cv_score(parsed_text, education_level)
|
| 29 |
+
|
| 30 |
+
st.header("CV Analysis Results")
|
| 31 |
+
st.write(f"**CV Type:** {cv_type}")
|
| 32 |
+
st.write(f"**Education Level:** {education_level}")
|
| 33 |
+
st.write(f"### Overall CV Score: {score} / 100")
|
| 34 |
+
st.write("### Score Breakdown:")
|
| 35 |
+
|
| 36 |
+
for k, v in score_breakdown.items():
|
| 37 |
+
st.write(f"- {k}: {v}")
|