Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a CLI interactive Python based Resume Builder #62

Merged
merged 3 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions Resume Builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Interactive Resume Builder

This Python project is a command-line interface (CLI) tool for building professional resumes. The tool allows users to interactively input various sections of their resume, such as contact information, work experience, education, skills, projects, certifications, and achievements. The resume is then formatted and exported as a PDF file.

## Features

- Interactive CLI for entering resume data (contact info, work experience, education, etc.).
- Ability to add, update, and modify multiple resume sections.
- Automatically generates a well-formatted PDF resume.
- Includes functionality to add detailed descriptions for work experience and projects.
- Supports multiple certifications and achievements.
- Simple and intuitive navigation using `prompt_toolkit` for menu interactions.

## Prerequisites

- Python 3.x must be installed on your system.

## Setup Instructions

1. **Clone the repository**:
```bash
git clone https://github.com/username/your-repo.git
cd your-repo
```

2. **Create and activate a virtual environment**:

For macOS/Linux:
```bash
python3 -m venv venv
source venv/bin/activate
```

For Windows:
```bash
python -m venv venv
venv\Scripts\activate
```

3. **Install the necessary dependencies**:
```bash
pip install -r requirements.txt
```

4. **Run the application**:
```bash
python resume_builder.py
```

## Usage

- **Interactive Menu**: The program presents a menu to select which section of the resume you want to edit or add.
- **PDF Generation**: Once all sections are filled, you can generate a PDF with all the input data.
- **Options**:
- Add or edit Contact Information, Work Experience, Education, Skills, Projects, Certifications, and Achievements.
- Generate the PDF after completing the resume input.

## Dependencies

- `geopy`: For any geographic distance calculation (if needed for future features).
- `prompt_toolkit`: A library for building beautiful command-line applications.
- `fpdf`: A library for generating PDF documents from the entered resume data.

## License

This project is licensed under the MIT License.
3 changes: 3 additions & 0 deletions Resume Builder/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
geopy==2.2.0
prompt_toolkit==3.0.8
fpdf==1.7.2
253 changes: 253 additions & 0 deletions Resume Builder/resume_builder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
from prompt_toolkit import prompt
from prompt_toolkit.shortcuts import button_dialog
from fpdf import FPDF
import os

# To clear the terminal after selecting a section
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')

# Resume data storage
resume_data = {
"contact_info": {},
"experience": [],
"education": [],
"skills": [],
"projects": [],
"certifications": [],
"achievements": []
}

# Function to navigate back to the main menu
def back_to_menu():
print("\nReturning to main menu...")

# Add contact information
def add_contact_info():
clear_screen()
print("Enter Contact Information")
resume_data["contact_info"]["name"] = prompt("Name: ")
resume_data["contact_info"]["email"] = prompt("Email: ")
resume_data["contact_info"]["phone"] = prompt("Phone: ")
resume_data["contact_info"]["address"] = prompt("Address: ")
resume_data["contact_info"]["linkedin"] = prompt("LinkedIn URL: ")
resume_data["contact_info"]["github"] = prompt("GitHub URL: ")
back_to_menu()

# Add work experience
def add_experience():
while True:
clear_screen()
print("Enter Work Experience")
experience = {
"title": prompt("Job Title: "),
"company": prompt("Company: "),
"start_date": prompt("Start Date (e.g., June 2024): "),
"end_date": prompt("End Date (or type 'Present' if still working): "),
"details": prompt("Details (comma-separated): ").split(',')
}
resume_data["experience"].append(experience)

# Ask user if they want to add more experience entries
more = prompt("Do you want to add more work experience? (yes/no): ").strip().lower()
if more == "no":
break
back_to_menu()

# Add education details
def add_education():
while True:
clear_screen()
print("Enter Education Information")
education = {
"degree": prompt("Degree (e.g., B.Tech in CSE): "),
"institution": prompt("Institution: "),
"start_year": prompt("Start Year: "),
"end_year": prompt("End Year: ")
}
resume_data["education"].append(education)

# Ask user if they want to add more education entries
more = prompt("Do you want to add more education? (yes/no): ").strip().lower()
if more == "no":
break
back_to_menu()

# Add skills
def add_skills():
clear_screen()
print("Enter Skills (comma-separated): ")
resume_data["skills"] = prompt("Skills: ").split(',')
back_to_menu()

# Add projects
def add_projects():
while True:
clear_screen()
print("Enter Projects Information")
project = {
"name": prompt("Project Name: "),
"description": prompt("Description: "),
"technologies": prompt("Technologies Used: ")
}
resume_data["projects"].append(project)

# Ask if they want to add more projects
more = prompt("Do you want to add more projects? (yes/no): ").strip().lower()
if more == "no":
break
back_to_menu()

# Add certifications
def add_certifications():
while True:
clear_screen()
print("Enter Certifications")
certification = {
"name": prompt("Certification Name: "),
"provider": prompt("Provider: "),
"year": prompt("Year: ")
}
resume_data["certifications"].append(certification)

more = prompt("Do you want to add more certifications? (yes/no): ").strip().lower()
if more == "no":
break
back_to_menu()

# Add achievements
def add_achievements():
while True:
clear_screen()
print("Enter Achievements")
achievement = prompt("Achievement: ")
resume_data["achievements"].append(achievement)

more = prompt("Do you want to add more achievements? (yes/no): ").strip().lower()
if more == "no":
break
back_to_menu()

# PDF Generation class
class ResumePDF(FPDF):
def header(self):
self.set_font('Arial', 'B', 14)
self.cell(0, 10, resume_data["contact_info"]["name"], 0, 1, 'C')
self.set_font('Arial', 'I', 12)
self.cell(0, 10, resume_data["contact_info"]["email"], 0, 1, 'C')
self.cell(0, 10, resume_data["contact_info"]["phone"], 0, 1, 'C')
self.cell(0, 10, resume_data["contact_info"]["address"], 0, 1, 'C')

def add_section(self, title, content):
self.set_font('Arial', 'B', 12)
self.cell(0, 10, title, 0, 1)
self.set_font('Arial', '', 11)
for line in content:
self.cell(0, 10, line, 0, 1)

# PDF Generation
def generate_pdf():
pdf = ResumePDF()
pdf.add_page()

# Contact Information
contact = resume_data["contact_info"]
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, f"{contact['name']} - {contact['email']}", 0, 1)
pdf.cell(0, 10, f"Phone: {contact['phone']} - Address: {contact['address']}", 0, 1)
pdf.cell(0, 10, f"LinkedIn: {contact.get('linkedin', 'N/A')} - GitHub: {contact.get('github', 'N/A')}", 0, 1)

# Work Experience
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Experience", 0, 1)
pdf.set_font('Arial', '', 11)
for exp in resume_data["experience"]:
details = ', '.join(exp["details"])
pdf.cell(0, 10, f"{exp['title']} at {exp['company']} ({exp['start_date']} - {exp['end_date']})", 0, 1)
pdf.multi_cell(0, 10, f"Responsibilities: {details}")

# Education
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Education", 0, 1)
pdf.set_font('Arial', '', 11)
for edu in resume_data["education"]:
pdf.cell(0, 10, f"{edu['degree']} from {edu['institution']} ({edu['start_year']} - {edu['end_year']})", 0, 1)

# Skills
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Skills", 0, 1)
pdf.multi_cell(0, 10, ', '.join(resume_data["skills"]))

# Projects
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Projects", 0, 1)
pdf.set_font('Arial', '', 11)
for proj in resume_data["projects"]:
pdf.cell(0, 10, proj["name"], 0, 1)
pdf.multi_cell(0, 10, proj["description"])
pdf.cell(0, 10, f"Technologies Used: {proj['technologies']}", 0, 1)

# Certifications
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Certifications", 0, 1)
pdf.set_font('Arial', '', 11)
for cert in resume_data["certifications"]:
pdf.cell(0, 10, f"{cert['name']} by {cert['provider']} ({cert['year']})", 0, 1)

# Achievements
pdf.set_font('Arial', 'B', 12)
pdf.cell(0, 10, "Achievements", 0, 1)
pdf.set_font('Arial', '', 11)
for ach in resume_data["achievements"]:
pdf.cell(0, 10, ach, 0, 1)

# Save PDF
pdf_output_path = "generated_resume.pdf"
pdf.output(pdf_output_path)

# Auto-open PDF after generation
os.system(f"start {pdf_output_path}" if os.name == "nt" else f"open {pdf_output_path}")
print(f"Resume generated: {pdf_output_path}")

# Main Menu using button_dialog from prompt_toolkit
def interactive_menu():
while True:
clear_screen()
choice = button_dialog(
title="Interactive Resume Builder",
text="Please choose a section to modify:",
buttons=[
("Contact Info", 1),
("Work Experience", 2),
("Education", 3),
("Skills", 4),
("Projects", 5),
("Certifications", 6),
("Achievements", 7),
("Generate PDF", 8),
("Exit", 9)
]
).run()

if choice == 1:
add_contact_info()
elif choice == 2:
add_experience()
elif choice == 3:
add_education()
elif choice == 4:
add_skills()
elif choice == 5:
add_projects()
elif choice == 6:
add_certifications()
elif choice == 7:
add_achievements()
elif choice == 8:
generate_pdf()
elif choice == 9:
break

# Start the program
if __name__ == "__main__":
interactive_menu()
Loading