HR Birthday Letter Generator
A simple Python project to generate milestone birthday letters for employees and deliver them through managers. It can be used from the command line or through a small desktop app for office users.
Project structure
generate_birthday_letters.py- package entrypoint scriptbirthday_letters_app.py- desktop app entrypointStart Birthday Letters.bat- Windows launcher for the desktop apphr_birthday_letters/- package source codehr_birthday_letters/templates/- language-specific mail cover and PDF letter templatesemployees.csv- sample employee data filetests/- unit testsoutput/- generated mail cover text files and PDF letters are saved here by default
CSV Format
Required columns:
NameDateOfBirth(YYYY-MM-DD)ManagerLanguage(matches a template file such asen.txtornl.txt)
Optional columns:
ManagerEmail(required when creating Outlook mails)EmployeeEmailDepartmentLocation
Example:
Name,DateOfBirth,Manager,ManagerEmail,Language,Department,Location
Alice Johnson,1996-05-28,Michael Smith,michael.smith@example.com,en,Engineering,New York
Ella Rodriguez,2001-05-28,Michael Smith,michael.smith@example.com,nl,Engineering,New York
Templates
Templates are plain text files stored in hr_birthday_letters/templates/ by default.
The employee Language value selects matching templates for both outputs:
- The mail cover text uses
hr_birthday_letters/templates/cover/<language>.txt - The PDF birthday letter uses
hr_birthday_letters/templates/letter/<language>.txt
For example, en uses both:
hr_birthday_letters/templates/cover/en.txthr_birthday_letters/templates/letter/en.txt
The cover text is high level and addressed to the manager. The PDF letter is addressed to the employee whose birthday milestone is being recognized.
Available placeholders:
$date$manager$manager_email$employee_name$employee_email$birthday$age$department$location$language
Install
Use Python 3.9+ and install the package in editable mode:
cd C:\Users\KRIJDI01\hr-birthday-letters
python -m pip install -e .
For Outlook desktop integration on Windows, install the optional office dependency:
python -m pip install -e ".[office]"
Desktop app
Start the app:
.\Start Birthday Letters.bat
Or run it with Python:
python birthday_letters_app.py
Or use the installed script:
hr-birthday-letters-ui
The app lets an office user:
- Select the employee CSV, output folder, and template folder
- Generate mail cover text files and PDF birthday letters
- Maintain cover and PDF letter templates by language
- Create Outlook drafts with the PDF attached
- Open Outlook mails for review or send immediately after confirmation
Run
python generate_birthday_letters.py employees.csv
Or use the installed CLI script:
hr-birthday-letters employees.csv
To specify a different output directory:
hr-birthday-letters employees.csv --output-dir letters
To use a custom template directory:
hr-birthday-letters employees.csv --template-dir templates
To create Outlook drafts from the command line:
hr-birthday-letters employees.csv --create-outlook-drafts
Other Outlook options:
hr-birthday-letters employees.csv --open-outlook-mails
hr-birthday-letters employees.csv --send-outlook-mails
The custom directory should use the same layout:
templates/
cover/
en.txt
nl.txt
letter/
en.txt
nl.txt
Test
Install the test dependencies first:
python -m pip install -e .[test]
python -m pytest
How it works
- Reads employee rows from a CSV file
- Computes each employee's age as of today
- Generates the cover text and PDF letter only when the age is a positive multiple of 5
- Selects cover and letter templates using the employee's
Languagevalue - Saves one manager-facing mail cover text file per eligible employee
- Saves one employee-facing birthday letter PDF per eligible employee
- Uses
ManagerEmailto create Outlook mails with the PDF attached
Metadata
Release files for hr-birthday-letters 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hr_birthday_letters-0.1.2.tar.gz | 15.4 kB | Without provenance | Details for hr_birthday_letters-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hr_birthday_letters-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for hr_birthday_letters-0.1.2-py3-none-any.whl |
Total release size: 30.1 kB
Release files / hr_birthday_letters-0.1.2.tar.gz
| Download URL | hr_birthday_letters-0.1.2.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27efc6d38c921f70018d80637684b1f2dd4fc70d5c6a21f0133c8287bd0a522d
|
|
BLAKE2b-256 checksum How to use checksums |
87a0c6c817f72cb1de01d0519ee44bba6abc11ca47bebcabd5d8a4d815fc2112
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / hr_birthday_letters-0.1.2-py3-none-any.whl
| Download URL | hr_birthday_letters-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dad28c4a66d26fe4750cc19a6d543a4409561994aed99d17b8e65a4eb0295f0
|
|
BLAKE2b-256 checksum How to use checksums |
c1e93c5bc281341faa6b26e9de58a1b9cd8fa76bacced0702b8f460b2e064932
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for hr-birthday-letters 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.