Skip to content

Gedcom 7 import plugin #744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: maintenance/gramps60
Choose a base branch
from

Conversation

DavidMStraub
Copy link
Member

This is a draft of an import plugin 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

@Call-Me-Dave

This comment was marked as outdated.

@emyoulation
Copy link
Contributor

emyoulation commented Jun 21, 2025

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

@DavidMStraub
Copy link
Member Author

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.

@GaryGriffin
Copy link
Member

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.

@DavidMStraub
Copy link
Member Author

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

@GaryGriffin
Copy link
Member

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

@DavidMStraub
Copy link
Member Author

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.

@GaryGriffin
Copy link
Member

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)

@DavidMStraub
Copy link
Member Author

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.

@GaryGriffin
Copy link
Member

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.

@DavidMStraub
Copy link
Member Author

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

@Call-Me-Dave
Copy link

Call-Me-Dave commented Jul 2, 2025

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.

@DavidMStraub
Copy link
Member Author

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.

@Call-Me-Dave
Copy link

Call-Me-Dave commented Jul 2, 2025

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
Copy link

@PQYPLZXHGF
Copy link

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 ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants