AI-Powered Resume Shortlisting Using Python + ChatGPT API

π Introduction
Resume shortlisting is one of the most time-consuming tasks for HR and recruitment teams. With hundreds of applications for each opening, manually reviewing every resume is not only inefficient but also prone to bias and inconsistency.
In this project, I built a smart AI-powered resume shortlisting tool using Python and the ChatGPT API, which evaluates resumes against a job description and provides a structured recommendation β all without any manual review!
π What This Project Does
β
Reads resumes (PDF format) from a folder
β
Reads a plain text Job Description (JD)
β
Sends both to ChatGPT via API
β
Gets back:
A relevance score (0β10)
Candidate strengths
Gaps (if any)
Final recommendation: Shortlist or Reject
β Saves everything to a clean Excel report
π§ Tech Stack
Python
PyPDF2 β to extract text from PDF resumes
OpenAI GPT-3.5 API β for intelligent evaluation
pandas β for Excel reporting
ποΈ Folder Structure
The folder structure for your project is organized as follows:
resume_filter_project/
job_description.txt
β Contains the job role details.resumes/
β A folder containing PDF resumes.john_doe.pdf
meera_singh.pdf
resume_
filter.py
β The main script for the project.Resume_Evaluation_Report.xlsx
β The output report containing the evaluation results.
π§ Prompt Used for ChatGPT
You are an expert recruiter.
Evaluate this resume against the job description below.
Job Description: [...job description content...]
Resume: [...resume content...]
Please answer:
Relevance Score (0β10):
Key Strengths:
Weak Areas (if any):
Final Recommendation (Shortlist/Reject):
π» Full Python Script (resume_filter.py)
import os
import PyPDF2
import openai
import pandas as pd
# Set your OpenAI API key
openai.api_key = "your-openai-api-key"
# Load job description
with open("job_description.txt", "r", encoding="utf-8") as f:
job_description = f.read()
# Folder containing resumes
resume_folder = "resumes"
evaluations = []
# Loop through PDF resumes
for file in os.listdir(resume_folder):
if file.lower().endswith(".pdf"):
with open(os.path.join(resume_folder, file), "rb") as f:
reader = PyPDF2.PdfReader(f)
resume_text = "".join([page.extract_text() or "" for page in reader.pages])
prompt = f"""
You are an expert recruiter.
Evaluate this resume against the job description below.
Job Description:
{job_description}
Resume:
{resume_text}
Please answer:
1. Relevance Score (0β10):
2. Key Strengths:
3. Weak Areas (if any):
4. Final Recommendation (Shortlist/Reject):
"""
# Call ChatGPT API
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": prompt}],
temperature=0.3
)
evaluations.append({
"Resume": file,
"Evaluation": response.choices[0].message.content.strip()
})
# Save to Excel
df = pd.DataFrame(evaluations)
df.to_excel("Resume_Evaluation_Report.xlsx", index=False)
print("β
Evaluation complete. Report saved.")
π Sample Output
Resume | Evaluation |
john_doe.pdf | Score: 8/10. Strong in Python, lacks Power BI. Recommendation: Shortlist |
meera.pdf | Score: 5/10. Experience not aligned with JD. Recommendation: Reject |
π£ Real-World Use Cases
This project can be adapted for:
HR tech startups
Recruitment firms
In-house HR teams automating hiring
Freelancers helping clients filter talent
π° API Cost Estimation (ChatGPT)
π§Ύ Chosen Model for Resume Project: GPT-4.1 nano
(Fastest, most cost-effective model as of May 2025)
Token Type | Price per 1M Tokens |
Input Tokens | $0.10 |
Output Tokens | $0.40 |
π Cost per Resume Evaluation (Approximate):
Component | Estimated Tokens | Approx Cost |
Job Description | 500 | $0.00005 |
Resume Content | 1500 | $0.00015 |
Output (Response) | 400 | $0.00016 |
Total per Resume | ~2,400 | ~$0.00036 (βΉ0.03) |
π Bulk Evaluation Cost (GPT-4.1 nano):
No. of Resumes | Approx Cost (USD) | Approx Cost (INR) |
100 | ~$0.04 | βΉ3.3 |
500 | ~$0.18 | βΉ15β16 |
1,000 | ~$0.36 | βΉ30β35 |
π This means you can screen 1,000 resumes for less than βΉ40 β making this tool incredibly scalable and affordable.
π’ Letβs Connect!
If you're working on automation or AI tools in HR, finance, or operations, Iβd love to connect and learn from your journey.
Follow me here or on LinkedIn for future posts!
π Drop your thoughts or feedback in the comments!
#Python #ChatGPT #AIProjects #Automation #Recruitment #CareerSwitch #OpenAI #PortfolioProject #PowerAutomate #TechForHR
Subscribe to my newsletter
Read articles from Sandeep Bhatt directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Sandeep Bhatt
Sandeep Bhatt
Process Automation Expert | Excel VBA & Power Automate Specialist | AI + RPA Explorer After 13 years of building automation solutions in Excel and VBA β from payroll systems to complex F&F workflows β I now focus on designing modern, intelligent automations using Microsoft Power Automate, RPA, and AI-powered tools. Iβm deeply interested in how prompt engineering, generative AI, and cloud-connected flows can replace repetitive work with smart, self-operating systems. My goal is simple: make operations faster, error-free, and future-proof. When Iβm not automating Excel or building flows, Iβm testing how AI can enhance decision-making and bring creative automation into everyday business.