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 work.

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 was not compatible with Gramps (lost of data, unknown markup…).
I found a discussion on a french genealogy forum, where someone succeded but never shared his code…
He explain 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 repo here // todo add link

To start, I extracted the Heredis SQLite database and made a copy :

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

Read SQLite database

To read a SQLite database, simply 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