Because it was completely empty and it was hiding the interesting part
Ah, ok, you did not generate “ghost families” for getting a relationships line between this uncle and his nephew. So, the relationship calculation returns an empty string.
Personally, I wish for an Associations gramplet, so that I don’t have to edit a person to look at their associations. It would be nice if such a gramplet showed all of the associations that a person is involved in, and showed the direction of each.
I guess that CheckAssociations addon was generated because there wasn’t a quick method to select people with associations data? That’s also why I was surprised you got it with few lines of code…
https://gramps.discourse.group/t/new-gram-py-script-for-6-0/7192/11?u=romjerome
Feel free to deprecate CheckAssociations addon. It still does the job: provide a way to check Associations into our database, but without advanced features, like a way for fixing some mistakes on seizure.
Please don’t eliminate that addon.
Once the hotlinking is implemented, it is similar to the “Type Cleanup” tool. It allows exposing all the Associations in the whole tree and allows sorting. Which make it simple to find Association types that need to be cleaned
Ah, yes, by deprecated, I should rather ask for a new maintainer after some improvements. As wrote before, it was one way for getting back some data not very accessible at a glance : all associations and linked/related people. So, feel free to improve the code or to generate a gramplet instead of an utility tool with possible performances issues on large database.
@Nick-Hall & @GaryGriffin
What is the preferred way to mark an Addon as open for adoption by a new Maintainer?
My feelings are similar about being the Maintainer for this tool. I’d like to share a day’s worth of wish-coded feature enhancements that make the Tool more than the current release’s Report-like functionality. (Tested with Gramps 5.2 version. Should be compatible with 5.2+ but needs testing.) Those enhancements are purely navigational in nature. The core function is unchanged.
But I do not want to become the Maintainer. Because a ‘recent’ Maintainer might discourage someone with good ideas for extending the core functionality. They should feel welcome to jump in with their own revision. A maintainer or recent copyright author may have connotations for Gary. Simple politeness demands that a private conversation be started to avoid stepping on their toes. And the Addon PRs feel as though they should be approved by the current Maintainer before publication.
Generally, I look at the author email in the GPR first. I try to send a review notice to any change the author did not do. I have not looked at the copyleft but that is a good idea too.
I know of no way to mark an Addon as ‘looking for a new owner’.
Tested with Gramps 5.2 version and python 3.10 (or +)?
+from typing import Optional, Tuple # Add this import at the top of the file
-def _get_selected_row(self) -> tuple | None:
+def _get_selected_row(self) -> Optional[Tuple]:
or if you prefer to keep tuple (without generics):
+from typing import Optional
-def _get_selected_row(self) -> tuple | None:
+def _get_selected_row(self) -> Optional[tuple]:
-def __init__(self, name, person_id: str | None = None) -> None:
+def __init__(self, name, person_id: Optional[str] = None) -> None:
Above changes will work with python version < 3.10 (like 3.8 for gramps 5.2).
I do not understand. I was led to believe that Gramps 5.2.2 uses its own sandboxed version of Python provided by the Installer. It apparently comes with 3.11.6 version. How would I test for 3.8 version?
GRAMPS: 5.2.2
Python: 3.11.6
BSDDB: 6.2.9 (5, 3, 28)
sqlite: 3.40.0 (2.6.0)
LANG: en_US.UTF-8
OS: Linux
Distribution: 6.5.12-100.fc37.x86_64
I was trying to play with Mistral AI Vibe Code work - trying to include one github repository - when I saw your PR. I tested your new version.
Note, we can clearly see that switching between branches is not only a code issue, also need to check the environment (ressources, dependencies or versions). e.g., the AI pointed out a wrong cause of failure for this code on gramps 5.2 branch.
It was not a blocking issue but rather a method issue: the experimental ‘person.serialize()[-1]’, which could failed in the future… An improvement or clean-up, but it was not the cause of failure under Gramps 5.2 and python 3.8. I said to the AI to re-check the possible cause and saw that its gramps source code reference was oriented 5.1 branch. So, it makes sense for any upgrade process but it could be a problem by downgrading (or backporting) some “recent” code or method (like typing on python 3.10).
For Gramps 5.2.4
Under Windows OS, Mac OS and the snap package. You can also download some .deb packages for Ubuntu 20.04 or 22.04, as well as the source code (e.g., 5.2.4), then run it without any build into a python/Gtk3 environment…
$ python3 Gramps.py
Maybe:
$ python -m venv my_env_for_3_8
then I suppose some additional stuff and virtual installations (like a new python version)?
ooof! Your skills are well-suited for this PR… far more than mine.
And Il used the GitHub Web GUI to submitt the changes to the .gpr.py, the .py and add the README.md file. Which caused 3 PRs instead of 1. (That means extra work for @GaryGriffin )
Do you want to reject my PRs and resubmit the right way — as yours? I did nothing more than operate the wish-coding AI. You, Claude and Copilot did all the heavy-lifting.
I also have some problems with my local gramps-addons git repository.
Unable to create branch: Please address the rule violations and try again.Learn more about rulesets.
This branch must not contain merge commits.
The 3 PRs are on the gramps52 branch. My suggestion is to close these and create a new single PR on the gramps60 branch.
I am not a fan of the extra python code in the GPR, preferring the fixed version number like it is now. Let me know if you want me to create the PR.
That was intentional. I did the tests on the 5.2 version, for the release with the 5.2 version. I am not using the 6.0 or 6.1 as my production version yet. I just use those for occasional testing.
My personal preference is towards the opposite. Although a LOT of extra python code in the GPR is unpleasant. I see no reason for a such a high-maintenance systems of Gramps version distinction and hassle of multiple repositories when the plugins are cross-compatible with several versions of Gramps.
I suppose you could add the line maintainers = ["Unmaintained"] to the gpr file after trying to contact the author. My original intention was that every addon should have a maintainer and an empty list would indicate the lack of a maintainer, but this field is not widely used yet.
If this could help, I was able to create a new banch by disabling an old ruleset.
Added as a draft one for Gramps 52 (and python 3.8 support)
It was not a blocking issue but rather a method issue: the experimental ‘person.serialize()[-1]’, which could failed in the future… An improvement or clean-up, but it was not the cause of failure under Gramps 5.2 and python 3.8.
Ah, yes, already get a failure on gramps 6.1 beta 1 (the last one will be now the familysearch_sync)…
Traceback (most recent call last):
File "/Users/gary/Library/Application Support/gramps/gramps61/plugins/AssociationsTool/associationstool.py", line 199, in _build_with_progress
_, _, _, two, value = ref
^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 5)
File "/Users/gary/Library/Application Support/gramps/gramps61/plugins/AssociationsTool/associationstool.py", line 71, in init
(a, b, c, two, value) = ref
^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 5)
two = RefBase.serialize(self) (handle de la personne associée)
value = self.rel (type de relation)
As proposed by the AI, a proper method should be:
for ref in person.get_person_ref_list():
two = ref.ref
value = str(ref.relation) # `relation` est un objet, convertissez-le en str si nécessaire
ok, I fixed (by myself, without AI) Claude’s lack… ![]()
Code should now be ready for a review on gramps 5.2 to 6.x branches. ![]()
Note, I did not yet run Vibe Code on my local gramps repositories, but I will also try an automatic review for these enhancements on the next hours… update
AssociationsTool Analysis
Overview
AssociationsTool is a Gramps addon designed to display, analyze, and edit person associations in a genealogy database.
The new version branch represents a major refactor of the original tool, introducing enhanced functionality, performance, and user experience.
File Structure
| File | Role | Changes (vs previous version) |
|---|---|---|
associationstool.py |
Main tool code | Complete refactor (120 → 735 lines) |
associationstool.gpr.py |
Gramps registration | Updated metadata (version 1.2.1, new authors) |
README.md |
Documentation | Added (detailed usage guide) |
Key Improvements (vs previous version)
| Aspect | previous version |
new version |
Impact |
|---|---|---|---|
| Code Size | ~120 lines | ~735 lines (6x larger) | |
| Features | Basic table display | Sortable, editable, context menu | |
| Error Handling | None | Robust (try/except everywhere) |
|
| Performance | Synchronous loading | Async batch processing | |
| UI/UX | Basic table | Interactive, modern GTK | |
| Documentation | Minimal | Complete (docstrings, README) | |
| Maintainability | Low | High (type hints, modular) |
Features
1. Core Functionality
- Displays all person associations in a sortable table.
- Calculates relationships between associated persons (e.g., “Father”, “Cousin”).
- Supports both GUI and CLI modes.
2. Interactive UI (GUI Mode)
| Feature | Description |
|---|---|
| Sortable Columns | Click headers to sort by name, relationship, or link type. |
| Double-Click Actions | Open editors for persons/associations directly. |
| Context Menu | Right-click for 5 actions (edit, copy, create note). |
| Tooltips | Hover over rows to see details (e.g., “Alice → Bob [Godparent]”). |
| Progress Bar | Shows processing status for large databases (>1s). |
| Status Bar | Displays total associations count. |
| Help Button | Opens the Gramps wiki page. |
3. Context Menu Actions
| Action | Description |
|---|---|
| Edit Starting Person | Open the Person Editor for the first person. |
| Edit Associate Person | Open the Person Editor for the associated person. |
| Edit Association | Open the Association Editor for the selected link. |
| Copy Row to Clipboard | Copy row data as tab-separated text (for Excel/CSV). |
| Create Note from Row | Generate a pre-formatted note with clickable person links. |
4. Note Creation Feature
- Creates a StyledText note with:
-
Association details (names, relationship, link type).
-
Clickable hyperlinks to person records (
gramps://Person/handle/...). -
Example output:
Association: Starting Person: Alice Relationship: Cousin (Godmother) Link type: Godparent→ Names are clickable in Gramps’ Note Editor.
-
5. CLI Mode
- Prints a formatted table to stdout:
Starting Name Calculated • Associate Link Type Alice Cousin • Bob Godparent
- Shows total associations count.
Technical Highlights
1. Asynchronous Data Loading
- Uses
GLib.idle_addto process data in batches (50 persons at a time). - Prevents UI freezing for large databases.
- Progress dialog appears after 1 second of processing.
2. Error Handling
- Comprehensive
try/exceptblocks for: - Database access (
get_person_from_handle). - Relationship calculation.
- GUI operations (e.g., progress dialog creation).
- Logging (
LOG.error,LOG.warning) for debugging.
3. Code Quality
- Type Hints: Uses
Optional,Tuplefor better IDE support. - Docstrings: All methods are documented.
- Constants: Named column indices (e.g.,
COL_NAME1 = 0). - Modularity: Separates logic into small, focused methods (e.g.,
_build_gui,_show_progress_dialog).
4. Gramps API Usage
- Backend-agnostic: Uses Gramps’ public API:
dbstate.db.get_person_handles()person.get_person_ref_list()get_relationship_calculator()- No direct database access (works with SQLite, PostgreSQL, etc.).
Strengths of new version Branch
| Category | Improvements |
|---|---|
Minor Areas for Improvement
| Issue | Severity | Suggested Fix |
|---|---|---|
Fixed batch_size = 50 |
Low | Make configurable or dynamic. |
| No filtering | Low | Add search bar or type filters. |
| No CSV export | Low | Add “Export to CSV” button. |
Fixed PROGRESS_THRESHOLD_MS |
Low | Adjust based on DB size. |
| No unit tests | Low | Add tests for critical methods. |
Comparison: previous version vs new one
| Criteria | previous |
new |
Gap |
|---|---|---|---|
| Lines of Code | ~120 | ~735 | +615 |
| Features | Basic | Advanced | |
| Error Handling | |||
| Performance | |||
| UI/UX | |||
| Documentation | |||
| Maintainability |
Conclusion
The new version branch is a complete rewrite of AssociationsTool, offering:
- Rich User Experience:
- Sortable, interactive table.
- Context menu with 5 useful actions.
- Double-click to edit directly.
- Smart note creation with clickable links.
- Optimized Performance:
- Async batch loading to prevent UI freezing.
- Progress bar for large databases.
- Robust & Maintainable Code:
- Type hints, docstrings, logging.
- Comprehensive error handling.
- Modular design (short, focused methods).
Recommendation
Use the new version branch: It is production-ready and far superior to previous version.
Optional Improvements:
- Add filtering (e.g., by association type).
- Support CSV/JSON export.
- Write unit tests for critical functions.
Useful Links
AssociationsTool Roadmap
Development roadmap for the Gramps AssociationsTool addon, structured by priority and complexity.
Overview
This roadmap outlines the future development of AssociationsTool, a Gramps addon for displaying, analyzing, and editing person associations. It is divided into 6 phases, prioritized by user needs, maintainability, and best practices for Gramps addons.
Priority Levels:
= Low ![]()
= Medium | ![]()
![]()
= High
Current Status (Branch: asso)
- Version: 1.2.1
- Compatibility: Gramps 5.2+ and 6.x (fixed via the
get_ref_relationhelper function). - Key Features:
- Sortable and interactive table.
- Context menu (edit, copy, create note).
- Double-click to edit.
- Progress bar for large databases.
- CLI and GUI modes.
Phase 1: Stabilization & Bug Fixes (Priority: 

)
Goal: Ensure the tool is reliable and bug-free for all users.
| Task | Description | Complexity | Benefit | Estimated Time |
|---|---|---|---|---|
| Test Gramps 5.2/6.x compatibility | Verify the recent fix works on both versions. | 1-2 hours | ||
| Add detailed logging | Improve log messages for debugging (e.g., LOG.debug for ignored associations). |
1 hour | ||
| Handle edge cases | Ensure get_relation() returns valid strings (not None or empty). |
1 hour | ||
| Validate performance | Test with a 10,000+ person database to detect slowdowns. | 2 hours |
Deliverable: A stable and tested version for Gramps 5.2 and 6.x.
Phase 2: User Improvements (Priority: 
)
Goal: Add practical features for end-users.
| Task | Description | Complexity | Benefit | Estimated Time |
|---|---|---|---|---|
| Filter by association type | Add a search bar to filter by type (e.g., “Godparent”, “Witness”). | 3-4 hours | ||
| Export to CSV/JSON | Add a button to export results to a file. | 4 hours | ||
| Multi-column sorting | Allow sorting by multiple columns (e.g., type then name). | 2 hours | ||
| Multi-row selection | Enable selecting multiple rows for batch actions (e.g., delete, export). | 3 hours | ||
| Customizable columns | Let users choose which columns to display. | 4 hours | ||
| Auto-refresh | Add a button to refresh data without closing the window. | 1 hour |
Deliverable: A more flexible and powerful tool for advanced users.
Phase 3: User Experience Enhancements (Priority: 
)
Goal: Improve ergonomics and accessibility.
| Task | Description | Complexity | Benefit | Estimated Time |
|---|---|---|---|---|
| Dark theme support | Adapt the UI for Gramps’ dark mode. | 2 hours | ||
| Keyboard shortcuts | Add shortcuts (e.g., Ctrl+C to copy, Ctrl+F to filter). |
3 hours | ||
| Enhanced tooltips | Add detailed descriptions for each column. | 1 hour | ||
| Icons for actions | Replace context menu text with icons. | 2 hours | ||
| Search history | Save last used filters. | 3 hours |
Deliverable: A more intuitive and modern user experience.
Phase 4: Advanced Features (Priority:
)
Goal: Add advanced capabilities for expert users.
| Task | Description | Complexity | Benefit | Estimated Time |
|---|---|---|---|---|
| Merge associations | Detect and merge duplicate associations (e.g., two “Godparent” entries for the same person). | 5 hours | ||
| Global statistics | Display statistics (e.g., number of associations per type). | 3 hours | ||
| Relationship graph | Generate a graph of associations (via Graphviz or DOT). | 6 hours | ||
| Advanced search | Filter by date, place, or other metadata. | 5 hours | ||
| Integration with other tools | Link with SyncAssociation or Gramps-Web. | 4 hours | ||
| Scripting support | Allow running custom scripts on selected associations. | 8 hours |
Deliverable: A powerful tool for genealogy experts.
Phase 5: Maintenance & Documentation (Priority: 
)
Goal: Ensure the project’s longevity.
| Task | Description | Complexity | Benefit | Estimated Time |
|---|---|---|---|---|
| Unit tests | Write tests for critical functions (e.g., get_ref_relation). |
4 hours | ||
| Technical documentation | Add a developer guide (e.g., how to extend the tool). | 2 hours | ||
| Translations | Update PO files for new features. | 2 hours | ||
| Changelog | Maintain a change log for users and maintainers. | 1 hour | ||
| CI/CD | Set up automated tests (GitHub Actions) for Gramps 5.2 and 6.x. | 3 hours |
Deliverable: A well-documented and maintainable project.
Phase 6: Community Integration (Priority:
)
Goal: Share and promote the tool.
| Task | Description | Complexity | Benefit | Estimated Time |
|---|---|---|---|---|
| Submit to Gramps Addons | Propose the tool for official integration in the Gramps repository. | 1 hour | ||
| Create a wiki page | Document the tool on the Gramps wiki. | 2 hours | ||
| Video tutorials | Create demonstration videos (e.g., YouTube). | 4 hours | ||
| User feedback | Collect feedback via forms or GitHub Issues. | 1 hour | ||
| Community presentation | Present the tool on the Gramps forum. | 1 hour |
Deliverable: Increased visibility and an engaged community.
Suggested Timeline
Based on part-time development.
| Phase | Duration | Deliverable | Priority |
|---|---|---|---|
| Phase 1 | 1-2 weeks | Stable version (1.2.2) | |
| Phase 2 | 2-3 weeks | Version with filters and export (1.3.0) | |
| Phase 3 | 2 weeks | Improved UX (1.4.0) | |
| Phase 4 | 3-4 weeks | Advanced features (2.0.0) | |
| Phase 5 | 2 weeks | Documentation and tests (2.0.0) | |
| Phase 6 | 1 week | Community integration |
Recommendations by User Profile
| Profile | Priority Phases | Goal |
|---|---|---|
| Beginner User | Phase 1 + Phase 2 | Reliable and simple tool. |
| Advanced User | Phase 1 + Phase 2 + Phase 4 | Powerful tool for analyzing associations. |
| Developer | Phase 1 + Phase 5 | Maintainable and tested code. |
| Maintainer | All phases | Sustainable and community-driven project. |
Bonus Ideas (Out of Scope)
If you want to go even further:
- External Tool Integration:
- Export to GEDCOM or FamilySearch.
- Link with Ancestry.com or MyHeritage.
- Semantic Analysis:
- Detect inconsistencies (e.g., a person associated as “Godparent” but without a baptism event).
- Machine Learning:
- Suggest missing associations (e.g., “This person is likely the godparent of X”).
- Collaboration:
- Allow multiple users to work on the same associations (via a server).
Next Steps
- Prioritize tasks based on your needs and available time.
- Start with Phase 1 (stabilization) if you want a reliable version quickly.
- Move to Phase 2 (filters, export) to add useful features.
- Document each step to ease maintenance.
More technical: