Resume Generator in Python.
About the project: This is the project for a Resume Generator in Python.
This will help you build a professional resume from your console.
This program will collect your personal details, work experience, and skills, and then format them into a clean, text-based resume that you can copy and paste or save to a file.
It also includes the functionality to save your data to a JSON file so you can easily load and edit it later.
How to use this program:
To use this Resume Generator, simply save the code as a Python file and run it from your terminal:
Save the code: Save the code below as a Python file (e.g., resume_generator.py).
Run the script: Open your terminal or command prompt, navigate to the directory where you saved the file, and run python report_generator.py.
Open your terminal or command prompt, navigate to the directory where you saved the file, and run python resume_generator.py.
The program will present you with a menu to create a new resume, load an existing one, or quit.
This text-based resume generator is a starting point. From here, you could explore more advanced features like generating a resume in a different format like PDF or HTML using libraries such as reportlab or jinja2.
Project Level: Intermediate
You can directly copy the below snippet code with the help of green copy button, paste it and run it in any Python editor you have.
Steps: Follow these stepsStep 1: Copy below code using green 'copy' button.
Step 2: Paste the code on your chosen editor.
Step 3: Save the code with filename and .py extention.
Step 4: Run (Press F5 if using python IDLE)
# resume_generator.py
import json
import os
# Filename for storing resume data
RESUME_FILE = "resume_data.json"
def get_user_info():
"""
Prompts the user for resume details and returns them as a dictionary.
"""
print("--- Let's build your resume! ---")
data = {}
# Personal Details
print("\n[Personal Details]")
data['name'] = input("Name: ").strip()
data['email'] = input("Email: ").strip()
data['phone'] = input("Phone: ").strip()
data['linkedin'] = input("LinkedIn URL (optional): ").strip()
data['portfolio'] = input("Portfolio/GitHub URL (optional): ").strip()
# Summary
print("\n[Professional Summary]")
print("Write a brief professional summary. Type 'END' on a new line when finished.")
summary_lines = []
while True:
line = input()
if line.strip().upper() == 'END':
break
summary_lines.append(line)
data['summary'] = "\n".join(summary_lines)
# Education
data['education'] = []
print("\n[Education] (Type 'done' for university name to finish)")
while True:
university = input("University/College: ").strip()
if university.lower() == 'done':
break
degree = input("Degree: ").strip()
dates = input("Dates (e.g., 2018 - 2022): ").strip()
data['education'].append({"university": university, "degree": degree, "dates": dates})
# Work Experience
data['experience'] = []
print("\n[Work Experience] (Type 'done' for job title to finish)")
while True:
job_title = input("Job Title: ").strip()
if job_title.lower() == 'done':
break
company = input("Company: ").strip()
dates = input("Dates (e.g., Jan 2022 - Present): ").strip()
responsibilities = []
print("Responsibilities (type 'done' on a new line to finish):")
while True:
bullet_point = input(" - ")
if bullet_point.strip().lower() == 'done':
break
responsibilities.append(bullet_point)
data['experience'].append({
"title": job_title,
"company": company,
"dates": dates,
"responsibilities": responsibilities
})
# Skills
print("\n[Skills]")
skills = input("Skills (comma-separated): ").strip()
data['skills'] = [s.strip() for s in skills.split(',') if s.strip()]
return data
def generate_resume(data):
"""
Generates a formatted text-based resume from the provided data.
"""
print("\n" + "="*80)
print(" " * ((80 - len(data['name'])) // 2) + data['name'])
print(" " * ((80 - len(data['email'] + " | " + data['phone'])) // 2) + f"{data['email']} | {data['phone']}")
if data['linkedin'] or data['portfolio']:
contact_info = []
if data['linkedin']:
contact_info.append(data['linkedin'])
if data['portfolio']:
contact_info.append(data['portfolio'])
print(" " * ((80 - len(" | ".join(contact_info))) // 2) + " | ".join(contact_info))
print("="*80)
print("\n--- Summary ---")
print(data['summary'])
print("\n--- Experience ---")
for job in data['experience']:
print(f"**{job['title']}** at **{job['company']}** | {job['dates']}")
for resp in job['responsibilities']:
print(f"- {resp}")
print()
print("\n--- Education ---")
for edu in data['education']:
print(f"**{edu['degree']}** | {edu['university']} | {edu['dates']}")
print("\n--- Skills ---")
print(", ".join(data['skills']))
print("\n" + "="*80)
def save_data(data):
"""
Saves the resume data dictionary to a JSON file.
"""
with open(RESUME_FILE, 'w') as f:
json.dump(data, f, indent=4)
print(f"Resume data saved to {RESUME_FILE}.")
def load_data():
"""
Loads resume data from a JSON file.
"""
if os.path.exists(RESUME_FILE):
with open(RESUME_FILE, 'r') as f:
return json.load(f)
return None
def main():
"""
Main function to run the Resume Generator app.
"""
print("--- Python Resume Generator ---")
while True:
print("\nMenu:")
print("1. Create a new resume")
print("2. Load an existing resume")
print("3. Quit")
choice = input("Enter your choice (1-3): ").strip()
if choice == '1':
resume_data = get_user_info()
if resume_data:
generate_resume(resume_data)
save_option = input("\nDo you want to save this data? (yes/no): ").strip().lower()
if save_option == 'yes':
save_data(resume_data)
else:
print("No resume data created.")
elif choice == '2':
resume_data = load_data()
if resume_data:
print("Resume data loaded successfully!")
generate_resume(resume_data)
print("\nNote: To edit, you'll need to create a new resume or manually edit the JSON file.")
else:
print("No existing resume data found.")
elif choice == '3':
print("Exiting Resume Generator. Goodbye!")
break
else:
print("Invalid choice. Please enter 1, 2, or 3.")
if __name__ == "__main__":
main()