Repository for a simple Python-based command line cover letter generator using a user-provided .docx
template
Install all dependencies (all four) through the provided requirements.txt
using
!pip install -r requirements.txt
in any Python
or Jupyter
file, or
python pip install -r requirements.txt
A working version of Microsoft Word will also be required (now offered through the Microsoft Office suite of apps, which can be downloaded here)
(Psst if you don't have Python installed, download it here and might I recommend an editor, mine of choice is Visual Studio Code)
Download and place the script cl-gen.py
file to the same location as the desired cover letter template .docx
file
- Change current directory to the location of the template (by default named
cover-letter-template.docx
but can be changed later)
For generating a single application (e.g. a single role for a single comapny)
- Use
python cover-gen.py [-name NAME] [--company COMPANY] [--role ROLE] [--name NAME] [--template TEMPLATE] [--folder FOLDER] [--pdf PDF]
With arguments:
-name
the name of the user, you--date
the date of the application, if different from today--company
the name of the company applying for--address
the address of the company you are applying for--role
the role applying for--event
event to mention in the application, e.g. networking event, company social--contact
the name of a contact within the comapny or otherwise--referral
the name of the person referring the user, you, to the company--hmanager
the name of the hiring manager (if known)--convo1
/--convo2
the contexts for conversations applicable to the application--other1
/--other2
other information as found pertinent to the application--template
the name of the template to be modified (defaults tocover-letter-template.docx
)--folder
Whether or not for the outputted.pdf
or.docx
file to be placed in a subfolder with the name of the associated company--pdf
whether or not to output a.pdf
or.docx
file
For generating multiple applications (i.e. multiple roles from multiple companies)
- Use
python cover-gen.py [-name NAME] [--template TEMPLATE] [--app_list APP_LIST] [--pdf PDF]
With arguments:
-name
the name of the user, you--template
the name of the template to be modified (defaults tocover-letter-template.docx
)--app_list
a.xlsx
or.csv
file in the format of having columns ofrole
andcompany
, with optional columns ofevent
andother
(as specified above)
Within the template (a .docx
document), the script effectively replaces all dates, companies, roles, events, contacts, referrers, hiring managers, conversations and "other" items found with the given format change:
{{NAME}}
->--name
in the format ofFirst
,Last
name{{DATE}}
->--date
in a generally accepted date format (e.g.BB dd, YYYY
;May 28, 2023
) if a singular entry or the row's value for a givendate
column if importing from a.csv
or.xlsx
or today's date (as provided bydatetime.date.today()
) if none provided{{COMPANY}}
->--company
if a singular entry or the row's value associated with the givencompany
column if importing from a.csv
or.xlsx
{{ADDRESS}}
->--address
if a singular entry or the row's value associated with a givenaddress
column if importing from a.csv
or.xlsx
- This is separated by at least 2 commas, e.g. "1234 Meridian Lane, New York, NY 10004"
{{ROLE}}
->--role
if a singular entry or the row's value associated with a givenrole
column if importing from a.csv
or.xlsx
{{EVENT}}
->--event
if a singular entry or the row's value associated with a givenevent
column if importing from a.csv
or.xlsx
{{CONTACT}}
->--contact
if a singular entry or the row's value associated with the givencontact
column if importing from a.csv
or.xlsx
{{REFERRAL}}
->--referral
if a singular entry or the row's value associated with the givenreferral
column if importing from a.csv
or.xlsx
{{HMANAGER}}
->--hmanager
if a singular entry or the row's value associated with the givenhiring manager
column if importing from a.csv
or.xlsx
{{CONVO1}}
/{{CONVO2}}
->--convo1
/--convo2
if a singular entry or the row's value associated with a givenfirst
/second conversation
column if importing from a.csv
or.xlsx
{{OTHER1}}
/{{OTHER2}}
->--other1
/--other2
if a singular entry or the row associated with a givenfirst
/second other
column if importing from a.csv
or.xlsx
As such, in the Word .docx
document, change each mention of a date, company, role, event, and "other" item accordingly, please take a peek at the given sample cover letter cover-letter-template.docx
(courtesy of ChatGPT), but an example would be "May 28, 2023" -> "{{DATE}}" in the .docx
(Microsoft Word) document
Simply either download the repository as a .zip
file or clone it to GitHub Desktop, follow the installation instructions above, and to test change the directory to the folder and run the commands:
python cover-gen.py -name "First Last" --template cover-letter-template.docx --app_list test_file.csv
If this works, replace the template with your own cover letter and list of companies to apply to with your custom list as well and all should run smoothly
Good luck applying :)
At the moment, attempting to implement two features and one potential API integration:
- The generation of multiple cover letters at once through reading in a
.xslx
or.csv
file containing company and roles (v2.0.0) - An
{{EVENT}}
flag, indicating any events attended by the user (v2.0.0) - An
{{OTHER}}
flag, indicating other, wildcard options the user would like to fill (v2.0.0) - A
{{HMANAGER}}
flag, indicating references to specific hiring managers (v3.0.0) - A
{{CONTACT}}
flag, indicatinga specific contact's name (v3.0.0) - An
{{ADDRESS}}
flag, with individual company addresses (v3.0.0) - A
{{DATE}}
flag, with specific dates that do not have to be today (v3.0.0) - The addition of one more
{{OTHER}}
flag (v3.0.0) - The addition of two
{{CONVO}}
flags, indicating interesting pieces of conversation to include in the cover letter (v3.0.0) - The addition of a way to not apply to duplicate jobs using the
applied
column - The integration of a feature to output the number of errors for each type (e.g.
3 address errors
/4 date format errors
) - The integration of a feature to output the companies/roles/applications associated with each error (e.g.
Company: Apple, Errors: [Role 1], [Role 2]; Company: Samsung, Errors: [Role 3], [Role 4]
- The integration of LangChain/LLMs to customize sections of cover letters (specifically replacing a
{{LLM}}
token with what the model thinks is an appropriate addition to the cover letter - Following from the above, this would include a link in
html
format to
Thanks to:
TextKool for its ASCII Art Generator
ChatGPT for providing the foundation for a cover letter template (found here), and assistance with two functions within the general code, namely parse_address
and parse_date
, providing novel solutions covering generalities that frankly, I had no idea how to even begin tackling
RegEx101 for providing quick and easy debugging for RegEx