addons-source icon indicating copy to clipboard operation
addons-source copied to clipboard

Gedcom 7 import addon

Open DavidMStraub opened this issue 6 months ago • 18 comments

This is a draft of an import addon for Gedcom 7 files based on the standalone library. The implementation is not complete yet, but ready for testing & feedback.

Two problems regarding the plugin (i.e., independent of the library):

  • When using ged as extension, the plugin is always overruled by the core Gedcom (6) plugin. That's why I had to change the extension to ged7, but that's an ugly hack. Is there a way around it?
  • I added gramps_gedcom7 (with underscore) to requires_mod because that's the module that is required, but there are two problems with this:
    • The package is called gramps-gedcom7 (with hyphen) and there is currently no way to specify that in the gpr file
    • There is currently no way to specify a target version of a pip package.

To install the required package, use

python -m pip install --upgrade gramps-gedcom7

DavidMStraub avatar Jun 21 '25 08:06 DavidMStraub

MIT license

Wrong license to be part of Gramps. But ok as third party addon!

EDIT: This is the addons-sources repository and I'm going to bed .... sorry for the noise!!

Call-Me-Dave avatar Jun 21 '25 09:06 Call-Me-Dave

In a Discourse "Idea" and related feature request, Woody notes that GedTool (VBA software $35) uses a "mapping table" GEDCOM dialect lookup file to map which importer to use. This differentiates between 5.5.x and 7.x and originating software.

https://gramps.discourse.group/t/new-gedcom-import-module/7045

There are other formats that could also benefit from version recognition branching. The built-in vCard importer only recognizes v3.0 (and only a limited subset) but many Smartphones only export v2.1

emyoulation avatar Jun 21 '25 11:06 emyoulation

The format version (e.g. "7.0") is required in the header in the Gedcom 7 specificiation so detecting it is trivial, the problem is just that this would require a change in Gramps core.

DavidMStraub avatar Jun 21 '25 14:06 DavidMStraub

I guess I am stupid, but I cannot see how to test (on Mac). I copied the ImportGedcom7 folder to my gramps60/plugins folder. Copied your maximal70.ged (to maximal70.ged7). Then went to FamilyTrees --> Import but gramps does not seem to find the new import type (ged7).

I tried both with and without the standalone (gramps-gedcom7) library - expected error on import without it. No warnings/errors in the console, so I suspect it is not installed correctly.

GaryGriffin avatar Jun 23 '25 16:06 GaryGriffin

Does GEDCOM 7 show up in the "Select file type" drop down in the file dialog? (Note: I was first confused because I had to scroll that dialog to see the last, new entry.)

DavidMStraub avatar Jun 23 '25 19:06 DavidMStraub

No, it does not. Below is the snapshot - there is no scrolling needed to see the full list.

Screenshot 2025-06-23 at 12 21 27 PM

GaryGriffin avatar Jun 23 '25 19:06 GaryGriffin

Was anyone else able to test this? Perhaps it's a Mac issue?

I noticed that this behaviour (Gedcom 7 not offered in the file dialog) happens when the library is not installed or not detected.

DavidMStraub avatar Jun 24 '25 19:06 DavidMStraub

I was expecting an error if the library was not installed in the line:

from gramps_gedcom7 import import_gedcom, ImportSettings

but didnt get any. I tried with and without the library installed - no difference. I put the gramps_gedcom7 folder in the same plugins folder (since Mac uses a bundle)

GaryGriffin avatar Jun 24 '25 19:06 GaryGriffin

I think the reason there is no error is that the module is listed as mod_required, and if that module is not importable, Gramps skips the initialization of the plugin, so it is silently absent.

DavidMStraub avatar Jun 24 '25 19:06 DavidMStraub

D'ohhhh

I manually installed gramps_gedcom7 not using pip (given gramps on a Mac is a bundle, any additional packages need to be added to the bundle and not to the standard OS). So I did not load gedcom7 package.

Once I also loaded gedcom7 v0.4.0, things worked.

GaryGriffin avatar Jun 24 '25 20:06 GaryGriffin

Did anyone have a chance to play around? How should I deal with the extension issue, should be advise users to rename their files?

DavidMStraub avatar Jul 02 '25 19:07 DavidMStraub

How should I deal with the extension issue, should be advise users to rename their files?

Maybe adapt the suggestion at the end this article?

Another way is to look at how the GEDCOM Extensions addon handles exports and see the enhancement request to refactor it to support imports?

  • 10550 Refactor Gramps GEDCOM import so as to support GEDCOM extension addons

The GEDCOM extension outputs the file to *.ged2 and afterwards, you can change the extension from ".ged2" to ".ged" and treat as a normal GEDCOM file.

Call-Me-Dave avatar Jul 02 '25 20:07 Call-Me-Dave

Detecting that a file is GEDCOM7 is easy, the problem is that currently, when it has extension .ged, Gramps core will use the built in parser and ignore the addon.

DavidMStraub avatar Jul 02 '25 20:07 DavidMStraub

Then Gramps core needs to be updated to support the detection or feature 10550 be implemented to monkey patch the Gramps GEDCOM import detection in your addon?

Call-Me-Dave avatar Jul 02 '25 20:07 Call-Me-Dave

Deleted the internal GEDCOM 5 importer; but probably could have hidden it via the plugin manager; which could be a suggestion to users of the addon at least during development?

Tested using the familysearch ged 7 example files and these so nothing from the wild yet.

Thanks for the addon ✨

PQYPLZXHGF avatar Jul 02 '25 21:07 PQYPLZXHGF

Exciting news @glamberson has submitted pr#1 that needs testing ( not sure if it works with this addon yet ) .

This PR adds support for three GEDCOM 7 extensions that enable full compatibility with GRAMPS' advanced data model, addressing the long-standing issue of data loss when exchanging GEDCOM files with GRAMPS

Note the PR was withdrawn see https://github.com/DavidMStraub/gramps-gedcom7/pull/1#issuecomment-3133442884

giotodibondone avatar Jul 28 '25 14:07 giotodibondone

How do we proceed? I think this could be merged if it weren't for the problem with the extension. Should we go with ged7 for now?

DavidMStraub avatar Oct 07 '25 18:10 DavidMStraub

How do we proceed? I think this could be merged if it weren't for the problem with the extension. Should we go with ged7 for now?

This gramplet is a very thin wrapper for the external library. I suspect very little maintenance will be needed in the gramplet, as opposed to updates to the external library.

Decision 1 options:

  1. Update core gedcom import for 6.1 to add recognizing gedcom version.
  • This eliminates the issue of the extension.
  1. Release separate Gedcom7 import module as 3rd party.
  • Would there be a roadmap for migrating from 3rd party to core or more likely, having it subsumed into current core gedcom import?
  • Still need the extension name resolved. And it may need changed later if subsumed into core.

Decision 2: how do we deal with the gramps-gedcom7 external library? If it is added to the Win/Mac bundle for 6.1, then its maintenance is tied to core releases, which is not optimal. Alternately, if it is not distributed with 6.1, then Win/Mac users cannot use it. And Linux users will need to pip install the library to access.

I think we need both decisions before going further.

GaryGriffin avatar Nov 24 '25 22:11 GaryGriffin

Should we go with ged7 for now?

@DavidMStraub Yes 👍 should allow people to initially use and test it.

And for the next Gramps major (6.1.x or 7.x.x) release decide what should happen?

Call-Me-Dave avatar Nov 24 '25 23:11 Call-Me-Dave

I think we need both decisions before going further.

I'm open to all options and waiting for the decision to be made.

DavidMStraub avatar Nov 25 '25 12:11 DavidMStraub