# Documenting parsing API

**URL:** <https://gramps.discourse.group/t/documenting-parsing-api/6485>\
**Category:** Development\
**Created:** [November 23, 2024, 1:25pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485 "2024-11-23T13:25:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsblank](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/dsblank/32/3649_2.png) [@dsblank](https://gramps.discourse.group/u/dsblank)\
**Post date:** [November 23, 2024, 1:25pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/1 "2024-11-23T13:25:19Z")

</div>

Saw this old post. Are you still interested in these questions?

Some of these use the same underlying parser that is built into Gramps. For example, Dates in [Data Entry](https://gramps-project.org/wiki/index.php/Addon:DataEntryGramplet) Gramplet, [Person Filter](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Gramplets#People_Filter), and [Date calculator](https://gramps-project.org/wiki/index.php/Addon:DateCalculator) all use the same [parser](https://github.com/gramps-project/gramps/blob/master/gramps/gen/datehandler/_dateparser.py#L199). What kinds of things are you looking for?

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 23, 2024, 1:48pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/2 "2024-11-23T13:48:58Z")

</div>

> [@dsblank](#):
>
> What kinds of things are you looking for?

The intent is to improve the wiki’s exposure of GUI options for parsing data. To allow users with no programming skills to find options.

AND… to help beginning developers find functional examples of parsing code (not pseudocode) so the can build their own tools.

For example, say that someone wants to build a form that takes a common obit header phrase to make a new person. (e.g., “John Smith Jones 1953 - November 23, 2024”) They might need examples of parsing a Name and a date range. And of creating a person object with 2 event objects

While talking to @kku , I realized that his Dates addon gramplet had a lot of date parsing example code and wasn’t included in the list. So that’s the addition to the posting.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 23, 2024, 2:14pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/3 "2024-11-23T14:14:25Z")

</div>

Still searching for an example of adding a common citation for object being created.

As an example of that obituary, I’d probably start with making a source of the newspaper, a citation with the publication date and page, a secondary Note object with the transcription.

I’d like to use the [Data Entry gramplet](https://www.gramps-project.org/wiki/index.php/Addon:DataEntryGramplet) or the [Import Text](https://www.gramps-project.org/wiki/index.php/Addon:Import_Text_Gramplet) gramplet to rough in the person. But those either share a Source (no citation) or create a separate new blank citation for a common source. Either way, I still have to hand-edit each Citation.

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/c/cbd172519739a5f7f1c1d2669c3c2817c5d5ef4d.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/d/dcd4ba16d76b96fa0b58715e68afd2cd8776c74c.png)

---

<div class="post-metadata">

**Author:** ![dsblank](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/dsblank/32/3649_2.png) [@dsblank](https://gramps.discourse.group/u/dsblank)\
**Post date:** [November 23, 2024, 2:18pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/4 "2024-11-23T14:18:59Z")

</div>

I see. One thing that would help would be links on the wiki pages for addons to the source code. It took me a while to find [Dates](https://github.com/Taapeli/isotammi-addons/blob/master/source/Dates/Dates.py)

BTW, this also uses the dateparser. It might be nice to have an article on how to use it.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 23, 2024, 2:47pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/5 "2024-11-23T14:47:39Z")

</div>

> [@dsblank](#):
>
> One thing that would help would be links on the wiki pages for addons to the source code.

@Nick-Hall has a prototype tool to build an [Template:Addon5.2 List](https://www.gramps-project.org/wiki/index.php?title=Template:Addons5.2) for the wiki from the plugin registration and an idea for template to wrap around Addon wiki articles that could include a link to the source. (Similar to the template for WikiPedia’s plug-ins) But it requires the Lua plug-in. Unfortunately, something in our MediaWiki has been blocking @gramps-project from installing plug-ins. So rather than hand-tweak wiki pages for 149 addons and then have to remove those tweaks, I’m waiting for the wiki problem to be fixed.

> [@dsblank](#):
>
> BTW, this also uses the dateparser. It might be nice to have an article on how to use it.

After expanding the [Dates gramplet](https://www.gramps-project.org/wiki/index.php/Addon:Isotammi_addons#Dates) subsection in the Isotammi wiki article, I discovered the help\_url was incorrect and submitted a PR with a correction. @kku comitted the changes within hours but decided (in response to [my feature request](https://github.com/Taapeli/isotammi-addons/issues/45#issue-2681271703) inspired by documenting) to tweak the gramplet a little before publishing an update.

One of the changes is that the “dateparser” step is being moved into a separate “Revalidate” option checkbox.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 23, 2024, 3:34pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/6 "2024-11-23T15:34:44Z")

</div>

> [@dsblank](#):
>
> It might be nice to have an article on how to use it.

Are you talking about a Sphinx article or a Wiki article?

There are 141 [matches found when](https://gramps-project.org/docs/search.html?q=dateparser) searching for `dateparser` in the Sphinx developer [documentation for Gramps](https://gramps.discourse.group/t/about-the-user-manual-category/2585).

For the life of me, I cannot grok the Sphinx format for parameters. So I determine that the function exists in Sphinx, then search for working example code using that function name on GitHub.

---

<div class="post-metadata">

**Author:** ![dsblank](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/dsblank/32/3649_2.png) [@dsblank](https://gramps.discourse.group/u/dsblank)\
**Post date:** [November 23, 2024, 3:48pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/7 "2024-11-23T15:48:24Z")

</div>

Actually, I was thinking about the Gramps blog. But I see that no one has blogged an article since [2015 when some crazy guy posted about using Prolog and family trees](https://gramps-project.org/blog/2015/05/using-prolog-to-analyze-your-family-tree) 🙂

I actually find github’s search better for these things.

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/b/b829bc57a7d89a15ea4b04f3796998263e6e9b93.png)

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 23, 2024, 4:18pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/8 "2024-11-23T16:18:28Z")

</div>

> [@dsblank](#):
>
> Actually, I was thinking about the Gramps blog.

The WordPress silo is aging poorly.

It is easy to gain WikiContributor access for the MediaWiki. The wiki is in constant revision and has accessible (although excruciating) support for localization.

It is unclear how to become a WordPress editor. Or learn how to Blog. And there is ZERO support non-English visitors. The browsing path to localized vital content (downloads, localized user manuals) is non-existent from the domain landing page.

Nick recently provided guidance for contibuting content to the Sphinx system. And it is fenced off enough that only core team can effectively contribute. It is painful enough that those (overloaded) team members are unlikely to add docs (or “useful snippets”) to help new contributors.

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [November 23, 2024, 8:42pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/9 "2024-11-23T20:42:06Z")

</div>

> [@emyoulation](#):
>
> @Nick-Hall has a prototype tool to build an [Template:Addon5.2 List](https://www.gramps-project.org/wiki/index.php?title=Template:Addons5.2) for the wiki from the plugin registration and an idea for template to wrap around Addon wiki articles that could include a link to the source. (Similar to the template for WikiPedia’s plug-ins) But it requires the Lua plug-in.

I adapted the MediaWiki information box for extensions. The simplified version still requires the [TemplateStyles](https://www.mediawiki.org/wiki/Extension:TemplateStyles) and ParserFunctions to run, but we have ParserFunctions installed already.

Someone else requested Lua, but I can’t remember the conversation.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 23, 2024, 8:54pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/10 "2024-11-23T20:54:09Z")

</div>

> [@Nick-Hall](#):
>
> Someone else requested Lua, but I can’t remember the conversation.

> [@Lost icons in the Wiki](https://gramps.discourse.group/t/lost-icons-in-the-wiki/1282/2):
>
> Yes I understand it, note I added the [Template:Icon](https://gramps-project.org/wiki/index.php?title=Template:Icon&action=history) page back in 2011 based on old style wikitext templates, and due to how the template works (expensive in processing power which is why it is broken!); it is no use working on it until Mediawiki has been upgraded by @sam888 who can then install the Lua script extension and then we can convert the old wikitext templates into a Lua module scripts! You can see the newer [Template:Icon](https://en.wikipedia.org/wiki/Template:Icon) over on Wikipedia uses the Lua script.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [January 22, 2025, 10:20pm UTC](https://gramps.discourse.group/t/documenting-parsing-api/6485/12 "2025-01-22T22:20:55Z")

</div>


