August 2023 update #32
robla
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi folks! I let this project sit on the backburner while I did other things. Then, earlier in 2023, I really committed myself to learning a parser generator known as "Lark" (see https://lark-parser.readthedocs.io/en/stable/ ). Due to a combination of my inability to fully get my head around the parse trees generated by Lark, and my stubbornness, I made all sorts of unpublished code earlier this year in hopes of using Lark to build a data model from my .abif example files. When I returned to work on ABIF stuff in July, I decided to embrace ugly regexps, and write some code in Perl. My Perl skills are not quite what they used to be, but I feel pretty comfortable in Python these days, so I switched back over.
The result: a Python script that doesn't rely on an external parsing library, but instead relies on regular expressions:
https://github.com/electorama/abiftool
I'm separating the specification out from my implementation. I've also licensed abiftool under GPLv3, which is very different than the permissive Apache 2.0 license that the ABIF specification is licensed under. I may change the license for abiftool to match this abif repo, but I'm hoping we see many implementations of ABIF out there (not just mine). Parsing ABIF with regexps isn't that hard, since there's a line-oriented nature to the format.
At some point in the near-ish future, I'd like to build up a public library of ABIF files, each of which corresponds to an election. For example, here's a valid ABIF file for the Tennessee example, used in many places on English Wikipedia and on electowiki:
I would like ABIF files for many elections that we frequently discuss available for all to analyze.
And thus, I need to get more active in working on creating .abif files, and promoting the use of .abif.
Rob Lanphier a.k.a. "robla"
August 21, 2023
Beta Was this translation helpful? Give feedback.
All reactions