greatgramps: a static site generator for GRAMPS family trees
Last year I came across a few paper family trees from different sections of my family my Gran had collected, and I decided to look for a way to digitise them and bring them all together. Firstly I scanned them all in to make digital copies, and then I looked to see if Ubuntu had any family tree software. I found GRAMPS, the brilliantly backronymed Genealogical Research and Analysis Management Programming System.
I spent some time entering all the names and dates into GRAMPS, combining the data from five different trees. I quickly got the hang of GRAMPS, and found it quite a useful tool for visualising and navigating the tree. I proceeded to ask my parents for more info on family members, filling in gaps and adding detail. I then went into the family history helpdesk at Manchester Central Library to learn about how to conduct research and go further back than the paper trees did. I got some guidance and continued my research at home using FreeBMD, FamilySearch and later, Ancestry.
I found Ancestry useful for finding actual records, but I found myself having to maintain a separate tree online as well as my GRAMPS tree on my computer, in order for Ancestry to be useful. Ancestry also requires a subscription to access records, and it's not a lot of use without one. It's well worth paying for a subscription on a month-by-month basis while you have the time and inclination to do some research, but if Ancestry was the only place you could access the data, that's no use either. Ancestry being on the web means you can share it with others, but even if you have a subscription, your family can't see the records you've collected without their own subscription.
Ancestry does let you download the images of records you've found, such as birth, baptism, marriage, death and burial records, and Census returns. I made an effort to download any records relating to direct ancestors, and keep them organised, but I didn't originally bother to associate them with events in GRAMPS because it didn't seem worth the effort.
Recently, I wondered how easy it would be to access the data in my GRAMPS database with Python, and potentially make a static site from the data. I guided Claude in the experiment and as usual, made quick progress and it soon became obvious I would be able to build something useful. I aimed to build a static site generator so I could host a browsable tree I could share with family. This was not just possible but easy because GRAMPS itself is written in Python, and has a Python library for accessing data from a database, so there was no reverse-engineering or guesswork.
I created a homepage with an overview of the family tree, individual pages for each person in the tree, then added lists of ancestors and descendants, tree views, maps of event locations, and quickly got something I could click around and explore. I found with it being a generated static site, clicking around is lightning fast — there's nothing to compute and nothing to wait for.
While building out the features I wanted, step-by-step with Claude, I tried creating events for a few Census returns and attached the images I got from Ancestry. It allowed me to view them within a person's life events in a way I thought would be worth adding, so I began to do this for as many ancestors as possible. In doing so I ended up scripting automations for common tasks, which alleviated the workload I'd have had doing this in the GRAMPS UI. I had a command to create a Census event with an image, one to list someone's children, and one to add people in bulk to an event, which would give me a preview to indicate the ages at the time so I could verify from the Ancestry record and the image itself. I did this for a few different tasks and turned it into a CLI.
I kept adding features to the interface, and I'm pleased with what I've ended up with — I have a private self-hosted site I can share with my family, and it's inspired me to add more detail to the tree because I can see images and maps alongside the data. Hopefully it will be useful to other people, and maybe even inspire people to create their own family tree in GRAMPS.
I also put together a demo tree generator, so I could build a website for a fake tree showcasing the features.
As well as the CLI for reading from and managing data in GRAMPS, I also added a PDF tree generator so I can generate ancestor, descendant and hourglass charts as printable PDFs.
I've released this as a library called greatgramps:
The library is in three parts, which require different dependencies:
- The CLI — the
grgrcommand-line tool - Static site builder — commands for generating the static site
- PDF generator — the
grgr pdfcommands for generating PDF trees
See the docs for more info.
Some screenshots from my demo tree:
This is yet another project I've been able to build out lightning fast with Claude.