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.txtin 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.docxbut 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:
-namethe name of the user, you--datethe date of the application, if different from today--companythe name of the company applying for--addressthe address of the company you are applying for--rolethe role applying for--eventevent to mention in the application, e.g. networking event, company social--contactthe name of a contact within the comapny or otherwise--referralthe name of the person referring the user, you, to the company--hmanagerthe name of the hiring manager (if known)--convo1/--convo2the contexts for conversations applicable to the application--other1/--other2other information as found pertinent to the application--templatethe name of the template to be modified (defaults tocover-letter-template.docx)--folderWhether or not for the outputted.pdfor.docxfile to be placed in a subfolder with the name of the associated company--pdfwhether or not to output a.pdfor.docxfile
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:
-namethe name of the user, you--templatethe name of the template to be modified (defaults tocover-letter-template.docx)--app_lista.xlsxor.csvfile in the format of having columns ofroleandcompany, with optional columns ofeventandother(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}}->--namein the format ofFirst,Lastname{{DATE}}->--datein a generally accepted date format (e.g.BB dd, YYYY;May 28, 2023) if a singular entry or the row's value for a givendatecolumn if importing from a.csvor.xlsxor today's date (as provided bydatetime.date.today()) if none provided{{COMPANY}}->--companyif a singular entry or the row's value associated with the givencompanycolumn if importing from a.csvor.xlsx{{ADDRESS}}->--addressif a singular entry or the row's value associated with a givenaddresscolumn if importing from a.csvor.xlsx- This is separated by at least 2 commas, e.g. "1234 Meridian Lane, New York, NY 10004"
{{ROLE}}->--roleif a singular entry or the row's value associated with a givenrolecolumn if importing from a.csvor.xlsx{{EVENT}}->--eventif a singular entry or the row's value associated with a giveneventcolumn if importing from a.csvor.xlsx{{CONTACT}}->--contactif a singular entry or the row's value associated with the givencontactcolumn if importing from a.csvor.xlsx{{REFERRAL}}->--referralif a singular entry or the row's value associated with the givenreferralcolumn if importing from a.csvor.xlsx{{HMANAGER}}->--hmanagerif a singular entry or the row's value associated with the givenhiring managercolumn if importing from a.csvor.xlsx{{CONVO1}}/{{CONVO2}}->--convo1/--convo2if a singular entry or the row's value associated with a givenfirst/second conversationcolumn if importing from a.csvor.xlsx{{OTHER1}}/{{OTHER2}}->--other1/--other2if a singular entry or the row associated with a givenfirst/second othercolumn if importing from a.csvor.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
.xslxor.csvfile 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
appliedcolumn - 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
htmlformat 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
