Posts Tagged ‘Gramps’

Announcing the GeneanetForGramps plugin

2020/12/06

I’m a happy user of Gramps, since the confinement started in France back
in March 2020. I had received since the death of my father a lot of documents that described my family, and I had also some holes in my understanding of some branches. I wanted to keep all these information easily on my computer, instead of on multiple unrelated sheets of paper. After looking at what was available, I decided to invest more time on Gramps and it turned out it was a perfect fit for my needs (well in fact it should be perfect for a lot of amator genealogists considering the high number of features it provides): ability to keep family trees and visualize them in multiple nice ways, ability to also store people images, as well as official acts related to their life, their profession, address and much more again.

The nice stuff for me was that Gramps is written in python, so could help me enrich my understanding of the language I’m practicing since 3 years now (even if I still prefer perl ;-))

And when you are looking for information around family members, you often find good details on Geneanet. It allows the sharing of numerous family trees published by many people, among them you’ll find some common ancestors ! And once you’ve found one, you can see the full tree going up, and you start copying information from it, to enrich your own tree. Of course *real* genealogists do not do that as they want to check with acts that this is indeed true, but I just have one life, and as with FLOSS, I like to rely on work done by others and just do new stuff to improve the global knowledge.

But it’s soon very painful to copy from Geneanet data that have been entered by others, because it takes time, it’s error prone, and a machine could do that instead no ? Well, Gramps has no way to do it, nor did I find anything related to exporting data from Geneanet. So python to the rescue 😉

I started by writing a script to extract data from Geneanet, using the lxml module which is very helpful to detect the tags that are in the Geneanet page and thus gather the information I needed to store that in a python object. Then, using the Gramps python module you can find whether the person already exists in the database and either include him or her if not, or modify (or not) the attributes if he or she was there. Then you add recursivity for ancestors to parse the tree, then you add recursivity for descendants to complete the tree, and then you add spouses support to cover it all. It took me a bit of time to make that work, but by june I had a good working setup. I was able to import in my test DB lots of people in one run, from the command line interface. Not everything was done, but as we were free tomove again, I used more to time to attend shows, exhibitions, visit museum, enjoy concerts again…

But as we were confined again in october, it was time to start thinking about the graphical interface, because at the end, I want to make it easy for my wife (and myself) to make such imports. Took me a bit of time to figure out which example was the closest to my case, in order to get inspiration from it, especially for the various parameters I wanted to make available. And this is now done and working as shown with this screenshot:

GeneanetForGramps plugin interface

Up to that point, I was still using the french web pages for Geneanet, but of course, if you want to make your plugin used world wide, you have to deal with internationalization. So that was the last step, replacing all hardcoded chains in the program by call to gettext and to translate stuff. Of course, it’s a bit mre difficult when you do string detection in pages, but it turned out that the code was clean enough to make it painless. And voilà ! I now have a working plugin that I try to integrate to the upstream project (see my pull requests). Hopefully it will be seen as useful and validated soon. Meanwhile you can integrate it yourself in your Gramps instance by downloading it from my Github repository as it’s AGPLv3.