A custom Places filter rule for Gramps that matches the named place itself plus every place enclosed by it — all the way down the place hierarchy.
Gramps already ships a place rule, "IsEnclosedBy", but it selects by Gramps ID. IDs change on backend upgrade, backup import and version switches, which makes ID-based filters brittle. This rule does the same job by place name, which is self-documenting and stable. If several places share a name, all of them are used as targets.
It is the Places-view companion to the person rule "People with an event in a place or its sub-places": same name-based, transitive enclosure, but here the result is the matching places themselves rather than people.
Close Gramps.
Extract the downloaded ZIP archive.
Copy or extract the project folder into your Gramps user plugin folder.
Keep the complete folder structure unchanged, including any locale folder
included with the project.
The user plugin folder is normally located here:
%AppData%\gramps\gramps<version>\plugins\~/.gramps/gramps<version>/plugins/~/Library/Application Support/gramps/gramps<version>/plugins/Replace <version> with the Gramps version folder used on your system.
Start Gramps again.
Check that the installed filter, rule, gramplet or tool is available where described in the project documentation.
If the project does not appear or fails to load, check Help → Plugin Manager for an error message.
Because the project was installed only in the user plugin folder, removing that folder removes the test installation without changing the original Gramps program files.
Langeland.
All places with that name are matched, and the place itself as well as
everything below it counts.Bagen.*, ^Skåne$, or Skåne|Fyn.The result is every place that is, or lies within, the named place — handy for scoping a jurisdiction, then reusing the filter in reports or exports.
By default the place name is matched exactly (ignoring upper/lower case). Ticking Use regular expressions switches the place-name field to a regular expression, searched anywhere in the name/title:
Langeland (unticked) — only places named exactly Langeland.Lange.* (ticked) — Langeland, Langeskov, …^Langeland$ (ticked) — exactly Langeland.Skåne|Fyn (ticked) — places named Skåne or Fyn.This differs from the usual Gramps behaviour. Gramps' standard rules that offer a "Use regular expressions" checkbox treat the unticked field as a substring (contains) match. This rule instead treats the unticked field as an exact, whole-name (case-insensitive) match. In both, ticked = a regular expression — so the only difference from the usual behaviour is the unticked default: exact here, contains elsewhere.
Note: in regex mode the pattern is also tested against each place's full title,
so an unanchored pattern can match via the title too; anchor with ^…$ for the
name field only.
The rule resolves the typed name to every place whose name/title matches, then a
place is selected if it is one of those targets or lies within one
(tested with Gramps' own located_in, so the "enclosed by" semantics are
identical to the built-in rule). Place hierarchies are shallow, so this is cheap
even on large trees.
GNU General Public License, version 2 or later — same as Gramps.
Ships with a Danish translation. Layout:
<addon folder>/
*.py *.gpr.py
po/template.pot po/da.po
locale/da/LC_MESSAGES/addon.mo
Gramps loads locale/<lang>/LC_MESSAGES/addon.mo automatically for that
language. To add a language, copy po/template.pot to po/<lang>.po, translate
each msgstr, compile to locale/<lang>/LC_MESSAGES/addon.mo
(msgfmt po/<lang>.po -o locale/<lang>/LC_MESSAGES/addon.mo), and restart.
Only strings unique to this addon are translated here. Standard Gramps terms — the General filters category name and the Use regular expressions checkbox — come from Gramps' own translations automatically.