Distinguish birth and married names in .ged file


In Gramps 5.2.1 on Linux I created a person with two names, one of type “Married Name” (the preferred one) and one of type “Birth Name” (an alternative one).

When I export the family tree as .ged file, the entries of these two names look like this:

1 NAME <given_name> /<married_family_name>/
2 TYPE married
2 GIVN <given_name>
2 SURN <family_name>
1 NAME <given_name> /<birth_family_name>/
2 GIVN <given_name>
2 SURN <birth_family_name>

Is there a way to also include TYPE birth in the .ged file? The type of the second name (the birth name) is not included in the .ged file. Maybe I am doing something wrong?

Thanks a lot for help,

The 5.5 version of GEDCOM did not support this. The NAME_TYPE added in 5.5.1 for just such purposes. And although the 5.5.1 was proposed in 1992, it was only finally approved in November 2019. I think the Gramps GEDCOM export is 5.5 version.

This loss in the Person data is mentioned in the wiki as a possible target for enhancement.

As you noticed, Gramps doesn’t export the TYPE for ‘birth’ names. Presumably the author thought that the birth name was the default and did not need the explicit TYPE export.

If you are feeling adventurous, this can be changed in the code fairly easily. You need to find the Gramps code for your version and OS; will be something like “/lib/python3.6/site-packages/gramps/plugins/export/exportgedcom.py”. Edit this file (save a copy first, just in case) and at about line 1306 (for 5.1.3, might be different for yours, 5.2.1 is not a Gramps version) you will find:

    if int(name.get_type()) == NameType.BIRTH:

Either remove these two lines, or comment them out by adding a ‘#’ at the beginning of the lines. Save and restart Gramps.


I’m finding that exportgedcom.py in a different folder. And those 2 lines continue with 2 elif clauses for (married & aka types) wrapped up with an ‘else’ passing through custom types.

Yep, me too.

I suspect the correct edit would be to have this:

if int(name.get_type()) == NameType.BIRTH:
    self._writeln(2, 'TYPE', 'birth')

If so, this should really be a PR on GitHub, which I’m happy to put in, though I think if one of the regular programmers did it, it would get more attention. There are a bunch of PRs open and the last closed one is from 26 days ago.

1 Like

Hey guys, thanks for your input.

Right, my gramps version is 5.1.2. Sorry for the Zahlendreher.

The solution for my issue is to use the json export format. Everything (I need so far) is exported there.

Can be closed here.

Well, is there any reason why it shouldn’t be the default behavior to export the types for birth and marriage names?

how does your way of handling names work with a woman getting married a second or third time and changing her name each time? how does it handle a woman being divorced (with either spouse starting it) and reverting her name to a previous name (birth name or an earlier marriage)?

it has always seemed right to me to handle each name change in the order they happen with the first being the first and default and expressed in that order as a compound name or the current where a simpler name is called for.

OK, I just put in a PR for the change I proposed above. @prculley

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.