Convert Heredis database to Gramps

Hello,

I wanted to convert my Heredis 2020 database to a Gramps one.
You will find here my notes about this effort.

Gramps is a free and open source genealogy software. You can find more here.


Disclaimer: this page is a work in progress!


Before converting

I started by exporting to GEDCOM format, because it’s an option in Heredis software.
I gave up quickly because the output file wasn’t compatible with Gramps (lost of data, unknown markup…).
I found a discussion on a French genealogy forum, where someone succeeded but never shared his code…
He explains that the Heredis database is a SQLite one.

So, let’s write the code!

Writing some code

Introduction

I will use Python to write the converter. The main reason is that I never made a real project with this language.

You can find the GitHub repository here // todo add link.

To start, I extracted the Heredis SQLite database and copied:

$ cp my-heredis.hmw/my-heredis.heredis ./heredis.db

Read SQLite database

To read a SQLite database, proceed like this

#!/usr/bin/python3
import sys, getopt, sqlite3

con = sqlite3.connect('heredis.db')
cur = con.cursor()
for row in cur.execute("SELECT * FROM table"):
    print(row)

Heredis SQLite database notes

I used dbdiagram.io to render the schema in a sort-of comprehensive one.

In my case, everything is in French.

Find below the schema in a picture (right click, and open in a new tab to zoom in):

Image description

The “main” table seems to be the ’Individus’, as we are storing … people!

// TODO: Continue writing…


Ressources