Turn the output of Gramps' Web Calendar report into clean, styled, mobile-friendly birthday and anniversary calendar pages for a family website.
The tool reads the plain HTML that Gramps' Web Calendar report writes to
cal/<year>/1.html … 12.html and rewrites those twelve pages in a consistent
house style — one page per month, with a month navigation bar, a year switcher,
and historical events tucked behind a per-day toggle.
The language of the finished calendar is controlled by the script. English and
Danish can be auto-detected from the Gramps export. Additional languages can be
used by adding a language pack and selecting it explicitly with --sprog.
My own calendar gets its data from the full web-based version of the family tree. That report is relatively heavy to generate when the only purpose is to update the calendar, and some users may not have a full web family tree at all.
Gramps' lighter Web Calendar report provides the same day-by-day calendar data, so this tool uses that report instead. A full family-site rebuild is not necessary.
The two Gramps reports differ in a few details, including cell IDs, monthly file names, and whether person links are present. This tool is written specifically for Web Calendar output generated with Link to Narrative Web turned off.
Tested with:
The release package contains:
webcal_kalender.pysprog/de.json — example German language packLICENSE.txtREADME.mdRELEASE_NOTES.mdIn Gramps, run:
Reports → Web Pages → Web Calendar
Use these settings:
cal.--sprog.Gramps writes the result to:
…/cal/<year>/1.html … 12.html
Extract the release ZIP into the folder that contains the cal folder.
For the normal case, no arguments are needed:
python webcal_kalender.py
The script then:
index_kalender.html.The generated calendar can be opened locally in a web browser.
| Option | Meaning |
|---|---|
--sti PATH |
Folder that contains cal/ (default: current folder). |
--aar YEAR |
Base year = this year + next year (default: current year). Set it if Gramps' start year is not the current year. |
--sprog CODE |
Select a language code, e.g. da, en, or de. English and Danish can be auto-detected from <html lang>; other languages must be selected manually. |
--ud FOLDER |
Write the styled pages to FOLDER/<year> instead of rewriting them in place. |
--json |
Also write kalender_data.json for each year (for debugging). |
--no-index |
Do not write index_kalender.html (it is written by default). |
--dump-sprog |
Write the built-in language packs to sprog/*.json as templates, then exit. |
For each built year, the script writes the following files to cal/<year>/
(or to the folder selected with --ud):
1.html … 12.html — the twelve styled month pageskalender.css — the shared stylesheetIt also writes one file in the site root (--sti):
index_kalender.html — a small redirect page that always sends visitors to
the current month of the current year, falling back to the base year when
needed. This gives the calendar one stable entry point.| Icon | Event | Info line |
|---|---|---|
| 🎂 | Birthday (living) | age, e.g. 72 years |
| 🕯️ | Birthday (deceased) | † <death date> |
| ✝ | Anniversary of a death | † <year of death> |
| 💍 | Wedding anniversary | e.g. 59 year anniversary or married 62 years (until 1995) |
Living birthdays are shown directly on the day.
Historical events, such as deceased birthdays, deaths, and anniversaries, are
collapsed behind a small +N ⭣ toggle so the calendar grid stays readable.
They expand when the toggle is clicked.
The script has built-in calendar language support for English (en) and Danish (da).
<html lang="…">.--sprog and require a matching language pack.Place a sprog/<code>.json file next to the script. No code change is needed.
For example:
python webcal_kalender.py --dump-sprog
cp sprog/en.json sprog/de.json
# Translate the values in de.json
python webcal_kalender.py --sprog de
--dump-sprog writes the built-in English and Danish language packs as
templates.
A language pack may be partial. Any missing key falls back to English.
The available keys are:
months, weekdays, title, page_title, years, legend_alive,
legend_dead, legend_death, legend_wedding, legend_hint,
toggle_title, wed_anniv, wed_married, wed_until, wed_word,
couple_join, html_lang.
A German starter pack, de.json, is included as an example.
The event wording is rebuilt from numerical information in the source, such as ages, years married, and year of death. This allows that wording to follow the calendar's selected language.
Source dates still come from the Gramps export, so the source language and date
format can matter when adding another language. For example, English Gramps
writes ISO-style dates such as 2016-10-05, which are language-neutral and
therefore convenient when building a third language from an English source.
For questions and troubleshooting, see:
https://myown-project.dk/support/index.html
Released under the GNU General Public License v2.0 or later (GPL-2.0-or-later), the same license as Gramps.
Henning — contact@myown-project.dk
https://myown-project.dk