Inquiry from Facebook group: Notes types in Gramplets

Hans Boldt, a Gramps user for about 9 years, is currently working up a Gramplet to generate WikiTree formatted Gramps biographical data to post to a WikiTree profile.

He posted the following inquiry to the Gramps for Genealogists Facebook group, hoping for some direction:

I started with the “Hello World” gramplet. For my initial “Consanguinuity” gramplet, I looked at some existing gramplets to get an idea of what to do. From those, I extrapolated some basic principles. You learn pretty quickly to differentiate between handles, references, and primary objects, as well as the importance of naming conventions.

Often, when getting into an unfamiliar area, I write some code, then use the Python debugger to see what objects I have and what methods are available. When stuck, I’ve generally searched through the code to try to find examples of what I want to do.

One specific thing I found confusing was the database signal coding needed to update the gramplet after a change to a person. It appears that there are different ways to do that, but it took some experimenting to get that to work right for me.

I’ve also had to learn Python GtK programming. On-line documentation for that is pretty good, and I can usually find what I’m looking for using Google.

Here’s one specific thing I was looking for. I wanted to get a Note with a specific type. Is there a better way than just iterating through the notes?

Visit his website to see some notes on his journey with Gramps.

Maybe the following that was listed on the The Gramps Developers Portal:

  • Signals and Callbacks - The Gramps signaling system used to pass changes in the db, GUI, or other sources to various elements (usually the GUI) that need to be updated when changes occur.

It sounds like he may have experimented his way through that. He replied “That page was way more information than what I needed at the time.”

But the Notes still has him stymied.

Is someone willing to Mentor developers who have privately developed add-ons?

Not on the development, but on how to get their creation into code review and, eventually, sharing their creation with the wider community?

(Hans is a retired programmer, so the following isn’t applicable to him… It would be good to encourage those who might have done tweaks but are anxious about what they consider ‘hacks’ would be received. We might gain access to new stuff!)

Thanks, Brian, for introducing me to this group! This looks like the place to be.

1 Like

Welcome

There was a recent posting to the email lists you may find helpful from @prculley

https://sourceforge.net/p/gramps/mailman/message/37214129/

1 Like

Thanks! I started my adventure in Gramps development with a gramplet that shows pedigree collapse for the active person as well as how the active person is related to their spouses. If that sounds like something that might be useful for others, I can proceed with that process. I still need to do a bit of work to make sure it meets coding standards, and to document the algorithms better.

Cheers! Hans

Back to your original question. To get a specific type of note, you could set up a proxydb with a filter that only returns that type of note. I bring that up to help educate, but I think that just iterating through the notes would be faster (that is what iterating through the proxydb would end up doing internally). And your setup for proxydb would be non-trivial.

If you want to know more, look at using a proxydb (gramps/gui/plug/export/_exportoptions.py will show you some code, used by the export routines).

2 Likes

Thanks for the reply, Paul! I figured iterating through the notes was the way to go. Just checking to see if there was a specific method for that task.

Cheers! Hans