4 April 2026

Python HTML calendar

Alex Chan in Creating a personalised bin calendar:

I start by generating an HTML calendar using Python. There’s a built-in calendar module, which lets you output calendars in different formats. It doesn’t embed individual date information in the <td> cells, so I customise the HTMLCalendar class to write the date as an id attribute.

Neat post from Alex. Can immediately think of a few places where this approach might be useful. Also wish I'd known that Python calendar module fifteen years ago when I spent a not insignificant amount of hours setting up a calendar grid in Photoshop by hand ^_^