A new WebSearch gramplet is ready

It loaded.

But when I added it to people, and attempted to do a search it gave this error.

137546: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "C:\Users\Public\Genealogy\gramps\gramps52\plugins\WebSearch\web_search.py", line 202, in on_link_clicked
    self.add_icon_event(VISITED_HASH_FILE_PATH, ICON_VISITED_PATH, tree_iter, 8)
  File "C:\Users\Public\Genealogy\gramps\gramps52\plugins\WebSearch\web_search.py", line 209, in add_icon_event
    self.website_loader.save_hash_to_file(hash_value, file_path)
  File "C:\Users\Public\Genealogy\gramps\gramps52\plugins\WebSearch\website_loader.py", line 80, in save_hash_to_file
    with open(file_path, "a", encoding="utf-8") as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Public\\Genealogy\\gramps\\gramps52\\plugins\\WebSearch\\data\\visited_links.txt'

I think, it can not find “data” directory in the project root. You can create it manually as an temporary solution. I will fix it tomorrow. Need to create the folder if missing

Adding the data folder worked! Now to test it.

1 Like

You will see the known issue when add link to note or attributes. It occurs not always. I have idea why it occurs but don’t know how to fix it right now.

Fixed in: v0.11.9-alpha

@emyoulation, I plan to make this configurable and extendable via JSON. Initially, I was thinking of implementing it through the UI settings, where all other gramplet settings are located. But it won’t be that simple, maybe later. Right now, I plan to read attributes and URLs in wildcard pair format from a JSON file. However, I’m not very familiar with which gramplets store UIDs in which attributes. And from what you’ve written, it seems that for a single domain, like findagrave.com, there might be different types of UIDs for different purposes (such as memorial, cemetery), so different wildcard masks will be needed. Do you have more information on what wildcards should be specified for each attribute? I could release a standard attributes list that covers the main user needs based on the naming conventions used in Gramps by various gramplets. Of course, users will be able to customize everything themselves, but if we hardcode some of these attributes into the project, it will make things much easier for them. Obviously, two different attributes with the same wildcard cannot be used for the same domain.

Nav type Attribute name url in wildcard format
Person profile .familysearch.org
Person sources .familysearch.org
Person profile wikitree.com
Person memorial .findagrave.com
Person cemetery .findagrave.com
Person graver .findagrave.com

@emyoulation, IUDs support is now ready!

A new configuration file, configs/attribute_mapping.json, has been added. This file contains mappings like the following:

json

CopyEdit

[
  {
    "nav_type": "Person",
    "attribute_name": "profile",
    "url_regex": ".*familysearch\\.org/.*/tree/person/details/.*",
    "variable_name": "fs_person_uid"
  },
  {
    "nav_type": "Person",
    "attribute_name": "sources",
    "url_regex": ".*familysearch\\.org.*",
    "variable_name": "fs_source_uid"
  }
]

Explanation of the fields:

  • nav_type – Currently, only attributes for Person entities are supported.
  • attribute_name – The name of a person’s attribute that contains a UUID.
  • url_regex – A regular expression that defines which URLs should use the corresponding person attribute.
  • variable_name – The external variable name used in URL patterns within CSV files.

Screenshot from 2025-03-16 15-56-33

Build: Release v0.12.9-alpha · jurchello/WebSearch · GitHub

I also can prepare regulars for everybody who saves external uuids in attributes, but I need a bit info:

  • URL example
  • Attribute name where uid is saving

@Nick-Hall the link above goes to a GitHub releases page for the experimental WebSearch addon by @Urchello

The GitHub Releases appears to have some benefit for developers in maintaining a archive of releases. But it has a penalty in managing installed addon versions compared to the make.py/addons-__.json system of the Addon Manager.

Is that trade-off real? Or can a developer be more efficient (in both delivery and archiving) if they use the make.py approach?

You just improved the PO portion generation options of the addons-source make.py script. (Thank you!) The Usages section in the README.md in addons-source discusses using make.py directly from GitHub for a clone of addons-source repository.

Is there a simplified guide to leveraging the make.py (locally for an installed addon; or, on directly GitHub for a personal repository) for generating the PO and the listings/download folders? Specifically calling the make.py from within Gramps using Python Eval built-in, or Python Shell, SuperTool, gram.py addon gramplets

A new small update. UID-icon is adding before urls which have UIDs from attributes:

Build: Release v0.13.9-alpha · jurchello/WebSearch · GitHub

1 Like

I tried all sorts of attribute_name variants … since I do not wanted be locked into FamilySearch for profile. (I want to re-use profile for WikiTree.)

I would change the .json and the Person attribute to match. Then restart Gramps with WebSearch in the People flat view sidebar. (Switch active person to another and person and back to force a refresh)

It only recognized lowercase attribute names. (using spaces, dashes, underscores and periods were OK)

It would recognize familysearch.profile for an Attribute name but not

  • FamilySearch.profile

I am curious how to use a language code parameter? (FindAGrave uses a language subdomain instead of the www. subdomain. No support for an https://en.findagrave.com yet. FamilySearch uses a https://www.familysearch.org/en/)

1 Like

@emyoulation got it, I will check it. Thanks!

1 Like

New variables for Places are added. The full Place variables:

place
root_place
latitude
longitude
type
title # its a full hierarchical comma separated place name

title is already used in csv:
Screenshot from 2025-03-17 09-15-00

Source code: Release v0.15.9-alpha · jurchello/WebSearch · GitHub

Fixed. The fix is tested on such variable name:

"variable_name": "FamilySearch.person_-uid"

So, lower/upper cases, dots, underscoreas, dashes are tested and supported now. I’ve pushed it in JSON as temporary configuration for testing.

Screenshot from 2025-03-17 10-13-04

Source code: Release v0.17.10-alpha · jurchello/WebSearch · GitHub

1 Like

Now links which use data from attributes, are moved to a separate uid-links.csv file. It can be temporary or permanent change - depends on users’ feedbacks.

uid-links have own Earch-sign in the second “Locale” column. How it looks on your OS? It looks good on ubuntu:

Source code: Release v0.17.11-alpha · jurchello/WebSearch · GitHub

1 Like

If you want to match only a specific language, e.g., English (/en/), use:
"url_regex": ".*familysearch\\.org/en/.*"
To match any language subdomain, you can use:
"url_regex": ".*\\.findagrave\\.com/.*"
If you only want to match en.findagrave.com specifically:
"url_regex": ".*en\\.findagrave\\.com/.*"
I didnt text it, but it should work: you even can list multiple language codes:
"url_regex": ".*familysearch\\.org/(en|de|fr)/.*"

Im not 100% sure that I’ve fully answered to your question. Is it what you asked? Or you want to have additional variable with current system language?

Now users have ability add own favourite static links into static-links.csv file for fast access:

Source code: Release v0.18.11-alpha · jurchello/WebSearch · GitHub

Now the biggest gramplet exception is fixed. Now adding notes and attributes to people work correct:

Update here: Release v0.18.12-alpha · jurchello/WebSearch · GitHub

It looks like some sites (like FamilySearch) may support seamless language switching. So if your Gramps is running in French, it will return the data with the GUI in that language.

Others (like FindAGrave) have a limited set of languages in the same way as Gramps. FindAGrave is a strange implementation that is still experimental. It does not fluidly change to the language code in the URL. There is also a default language cookie that override. That will (probably) change.

WikiTree is even more strange. The language code does not affect the GUI. It is just used for tuning their data entry form’s validation. (i.e., if in fr, it just suggests standard locations in France as the Place is being keyed in.) We can ignore their Language code.

@emyoulation I’ve added a new one variable for urls: locale

from gramps.gen.const import GRAMPS_LOCALE as glocale
glocale.language[0]


It is available for people, families, sources and places.
Hope, it solves all your needs. Pls. give me know if its not enough flexible for some scenarious.

Update is here: Release v0.19.13-alpha · jurchello/WebSearch · GitHub

1 Like