Core classes in gramps/gen/lib

I have completed my diagrams about the classes representing genealogical data. They are attached to this post for comments and improvement.

Primary objects:

Secondary Objects:

Note: from reading the code, there is no reason why Attribute and AttributeRoot are distinct.

Secondary Objects (references):

Gramps types:

If you find this kind of diagram useful, I can send them for publication in the wiki.


The Address & Researcher connection to the LocationBase feels wrong. Like Internet, LDS & Associations, these record elements seem to be more idiosyncratic than implied by the graphs.

Not that much. The inheritance is in the class creation. On a “logical” point of view, both the Researcher and Address dialogs request a “physical” address which is ultimately described in the LocationBase class.

These diagrams show what is under the hood. What a user sees through the UI (net yet analysed) can be radically changed by programmer’s intent. I.e. a UI dialog may involve several core classes.

I think these would be nice to have on the wiki; especially for new contributors. Nice job!

I do wonder: are these made manually or are they generated? Because if they are made manually, I would also clearly indicate on the wiki from which commit they are made, so it can be clear if they are outdated or not.


Diagrams are made manually. I move the boxes until the connector crossings are minimised. I could probably have used GraphViz but the preparation phase would have been much more user-unfriendly and I am not sure GraphViz would have laid out the diagrams as cleanly. Note also I’ve used both straight and curved connectors while GraphViz would have used only one brand.

All were done in LibreOffice Draw.

I have cloned the GitHub repo but I work on the 5.1.4 release. Nevertheless, you are right, I’ll add a caption with the reference.


For information, the SVG diagram on wiki, was a quick overview, by using ‘pyreverse’ (from pylint package).

$ pyreverse -A -S /home/blabla/gramps/tree/master/gramps/gen/lib/*.py -o > jpeg

1 Like

When looking for the Association data structure, its connection to the Person object seems to be missing from the Gramps Data Model wiki diagram by @Nick-Hall .

The GEPS 13 model overview diagram for the WebApp by DSBlank has has its resolution degraded… so it is not actually readable enough to check.

Does the Association appear in any of these newer model diagrams?

Association information is stored in the PersonRef secondary object stored in the person_ref_list in the Person object. The PersonRef in the first person points to the second, so to setup a two way association you have to add a PersonRef to the second person pointing back to the first.

1 Like

Just a tip, not a comment on the diagrams themself:

If you use the application “” (there is a desktop version for any of the desktop OS), you can actually save the diagram as a CSV file and just add or edit the diagram in CSV and then import it and generate new “maps”.

It has a similar syntax as Graphviz just in CSV.

It can save the diagrams in both jpg and svg, and also has functions for advanced interactive graphs.

It also have a plugin for VSCode and VSCodium if that is of interest.

PS. I know Draw in LibreOffice/OpenOffice is a really good diagram/drawing software, so this is just a tip for a software that has much of the same feature as Microsoft Visio.