Spaces:
Sleeping
Sleeping
Upload 3 files
Browse filesFiles changed (3)
- README.md+7-10
- requirements.txtAdded+4
- resume.pyAdded+76
123456789101234567---title: Resume ATS Checkeremoji: 📚colorFrom: purplecolorTo: greensdk: staticpinned: false---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference---
sdk: streamlit
app_file: resume.py
---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference1234streamlit
google-generativeai
python-dotenv
PyPDF212345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576import streamlit as st
from PyPDF2 import PdfReader
import google.generativeai as genai
# Sample job description
JOB_DESCRIPTION = """
Data Analyst role requiring skills in Excel, SQL, Power BI, Python, and AWS.
Tasks: Analyze data, create dashboards, write SQL queries, automate tasks, ensure data quality.
"""
# Function to extract text from PDF
def extract_pdf_text(file):
try:
reader = PdfReader(file)
text = ""
for page in reader.pages:
text += page.extract_text() or ""
return text
except:
return ""
# Function to get AI analysis
def analyze_resume(resume_text, api_key):
try:
genai.configure(api_key=api_key)
model = genai.GenerativeModel('gemini-1.5-flash-8b')
prompt = f"""
Review this resume for a Data Analyst role:
- Assign a Match Score (0-100)% based on alignment with the job description.
- List 3 matching keywords and 3 missing keywords.
- Highlight 2 strengths and 2 gaps.
- Suggest 2 improvements.
- Verdict: Strong, Average, or Needs Work.
Job Description: {JOB_DESCRIPTION}
Resume: {resume_text}
"""
response = model.generate_content(prompt)
return response.text
except Exception as e:
return f"Error: {e}"
# Streamlit app
st.title("Resume Checker for Data Analyst")
st.write("Enter your Gemini API key and upload your resume (PDF) to check alignment with a Data Analyst job.")
# API key input
api_key = st.text_input("Enter Gemini API Key", type="password")
# File uploader
uploaded_file = st.file_uploader("Upload PDF Resume", type=["pdf"])
if uploaded_file and api_key:
resume_text = extract_pdf_text(uploaded_file)
if resume_text:
if st.button("Analyze Resume"):
with st.spinner("Analyzing..."):
result = analyze_resume(resume_text, api_key)
st.subheader("Resume Analysis")
st.write(result)
else:
st.error("Could not extract text from PDF. Use a text-based PDF.")
elif not api_key:
st.warning("Please enter your Gemini API key.")
else:
st.info("Upload a PDF resume to start.")
# Footer
st.markdown("---")
st.markdown("""
<div style='text-align: center; font-size: 15px;'>
Made with ❤️ by <b>Shashank Kashyap</b> | Founder of <a href='https://flexingdata.com' target='_blank'><b>Flexing Data</b></a><br>
Empowering future Data Analysts with AI-driven tools & industry-ready profiles.<br><br>
🌐 <a href='https://flexingdata.com' target='_blank'>Visit Website</a> |
🔗 <a href='https://www.linkedin.com/in/imshashankashyap/' target='_blank'>Connect on LinkedIn</a>
</div>
""", unsafe_allow_html=True)README.md+7-10
requirements.txtAdded+4
resume.pyAdded+76