Skip to content

Repository for a simple Python-based, command line interface cover letter generator using a user-defined base docx template

License

Notifications You must be signed in to change notification settings

sunnydigital/cover-gen

Repository files navigation

Command Line Interface Cover Letter Generator

Repository for a simple Python-based command line cover letter generator using a user-provided .docx template

Command Line Example

Dependencies

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)

Usage

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)

Single Application Generation

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:

  1. -name the name of the user, you
  2. --date the date of the application, if different from today
  3. --company the name of the company applying for
  4. --address the address of the company you are applying for
  5. --role the role applying for
  6. --event event to mention in the application, e.g. networking event, company social
  7. --contact the name of a contact within the comapny or otherwise
  8. --referral the name of the person referring the user, you, to the company
  9. --hmanager the name of the hiring manager (if known)
  10. --convo1/--convo2 the contexts for conversations applicable to the application
  11. --other1/--other2 other information as found pertinent to the application
  12. --template the name of the template to be modified (defaults to cover-letter-template.docx)
  13. --folder Whether or not for the outputted .pdf or .docx file to be placed in a subfolder with the name of the associated company
  14. --pdf whether or not to output a .pdf or .docx file

Multi Application Generation

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:

  1. -name the name of the user, you
  2. --template the name of the template to be modified (defaults to cover-letter-template.docx)
  3. --app_list a .xlsx or .csv file in the format of having columns of role and company, with optional columns of event and other (as specified above)

Template

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 of First, 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 given date column if importing from a .csv or .xlsx or today's date (as provided by datetime.date.today()) if none provided
  • {{COMPANY}} -> --company if a singular entry or the row's value associated with the given company column if importing from a .csv or .xlsx
  • {{ADDRESS}} -> --address if a singular entry or the row's value associated with a given address 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 given role column if importing from a .csv or .xlsx
  • {{EVENT}} -> --event if a singular entry or the row's value associated with a given event column if importing from a .csv or .xlsx
  • {{CONTACT}} -> --contact if a singular entry or the row's value associated with the given contact column if importing from a .csv or .xlsx
  • {{REFERRAL}} -> --referral if a singular entry or the row's value associated with the given referral column if importing from a .csv or .xlsx
  • {{HMANAGER}} -> --hmanager if a singular entry or the row's value associated with the given hiring 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 given first/second conversation column if importing from a .csv or .xlsx
  • {{OTHER1}}/{{OTHER2}} -> --other1/--other2 if a singular entry or the row associated with a given first/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

Download and Implementation

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 :)

Future Updates/Update Log

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

Acknowledgements and Thanks

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

About

Repository for a simple Python-based, command line interface cover letter generator using a user-defined base docx template

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages