When I was applying to lots of internships in my freshmen year of school, I was frustrated with having to create a unique cover letter for each company I applied to. Tired of the manual labor, I decided to automate the whole process so it works in a single button click. This project automates the generation of personalized cover letters by filling in a customizable PDF template with job-specific information.
- Extracts text from a PDF cover letter template
- Replaces placeholder variables with user-defined values
- Cleans and formats the resulting text
- Exports the final version as a new PDF
.
βββ main.py # Main script to generate cover letters
βββ CL_TEMPLATE_3.pdf # Your cover letter template (edit path in code)
βββ /Companies/ # Folder where output PDFs are saved
- Python 3
- pdfminer.six β for extracting text from PDF
- fpdf β for writing the final PDF
reβ for text formatting and cleanup
- Define the job-specific variables in the
main()function. - Extract the template text from
CL_TEMPLATE_3.pdf. - Replace placeholders (e.g.,
[Company Name],[Position Name], etc.) with the actual values. - Clean the text formatting and structure.
- Generate a new PDF and save it to a
Companiesdirectory with a company-specific filename.
These must exist in your PDF template:
[Position Name][Company Name][Specific Company Value][Company Address][Industry/Field][Hiring Manager][myName][myEmail][myNumber]
-
Install dependencies:
pip install pdfminer.six pip install fpdf
-
Adjust the variables and file paths in
main.py:- Make sure
templatePathpoints to your PDF template. - Make sure
outputPathpoints to a valid save location.
- Make sure
-
Run the script:
python main.py
-
The output PDF will be saved in the
Companies/folder with a filename likeGoogle ._CoverLetter.pdf.
This tool is great for students or professionals who are applying to multiple companies and want to speed up the process of customizing cover letters.