Site logoTungTT

Love Letter - a personalized love letter generator

2 minutes
357 words

Unlike the math modeling posts you usually see on this blog, this one is a small gift: a tool that turns a few lines of your feelings into a beautiful-looking letter.

love_letter_preview

Why I made this#

My feelings usually aren't easy to say out loud, but writing them down, with some preparation, is a different story. Still, a plain text message felt too ordinary, so I chose to write a letter instead. The problem was, after years of studying and working while just typing code, my handwriting has gotten really bad - and bad handwriting pretty much cuts a letter's value in half 😂.

So I built this project to fix that: just prepare the content, and the project outputs a single .html file - send it through any chat app, and the recipient just needs to tap it to view it right away. It can also be customized by theme, to make the "letter" feel even more special.

11 "moods" to choose from#

The project ships with 11 templates, each with its own color palette and mood. The letter's content stays the same - just switch templates to get a completely different vibe.

Try them out below:

How to use it#

Get Python ready, install the jinja2 and pyyaml libraries, write your letter's content into a YAML file, then run

python generate.py

The script will ask you to pick a content file and a template, then output a single .html file in output/ - send that file to the recipient and you're done.

Code available at Tung-hehe/love-letter

Happy coding, and may your feelings be fully received through every letter!