Repository navigation
Add five parliaments and Malaysia's election candidates to the local corpora - #1472
Merged
Merged
Conversation
…corpora opensanctions-parliaments reads Malaysia's Dewan Rakyat, Pakistan's National Assembly and Senate, Egypt's House of Representatives and Somalia's House of the People beside its twenty-three chambers. A new local corpus, my-candidates, reads Malaysia's GE12-GE15 and 2023 state-election candidates from five pinned CSVs, grouped by ethnicity (#1465). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… fix Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the sources the 3.2 research round (#1465) found worth keeping as local corpora. No file under
nameparser/changes and no parse moves:tools/differential/snapshot.jsonlis byte-identical.opensanctions-parliaments: five more chamberslocal_parliaments.DATASETSgainsmy_parliament,pk_na_members,pk_senate_members,eg_house_representativesandso_house_people: twenty-eight national chambers plus Indonesia's 2018 regional heads (29 datasets). Each export has the columns the loader reads (id,schema,name,aliases), and before adding them each was read through the unchanged_read. Every row is aPerson, with no malformed rows and no foreign separators.my_parliamentbinora/lthe name leaves outpk_na_memberspk_senate_memberseg_house_representativesso_house_peopleAs fetched on 2026-11-19, the whole corpus holds 20,856 members, 26,515 spellings and 26,400 distinct names. Licence: CC BY-NC 4.0, crediting OpenSanctions, the same as the datasets already there.
my-candidates: a new local corpustools/differential/local_mycandidates.pyreads Malaysia's candidates from Thevesh Theva'sanalysis-election-msia:data/candidates_ge12.csvtocandidates_ge15.csvandcandidates_prn15.csv. The fetch is pinned to commitb20331b0(the repository's last, 2023-08-13), with a sha256 for each file.Which column is read. GE12 to GE14 have one name column, the ballot name. GE15's
nameis the full name recased into title case by the repository's author. The capitals it came from are not in the file, so onlyname_display(the ballot name, in capitals) is read. PRN15 writes both of its columns in capitals, soname_ballotandnameare read, as the formsballotandfull.What a record is. One distinct spelling within an election and ethnicity, with
election,formandethnicity.ethnicityis theSource.group, soconfig_diff.py --group chineseworks. The general elections writebumiputera, which takes in Sabah's and Sarawak's peoples; PRN15's peninsular states writemalay.Size as fetched on 2026-11-19. 3,261 rows gave 3,683 spellings (3,260 ballot, 423 full) and 3,077 distinct names.
What it measures.
BIN,BINTI,B.andBT(#1467);A/L,A/PandANAK(#1468); the@alias (#1164);MD; honorific heads such asUSTAZandCIKGU(#1179); Chinese names written family first (#1183).Licence. GPL-3.0. The data is cached only, never committed or shipped, and the README row says so.
shipped-data-licencescovers shipped data only, so nothing is recorded there.Refusals. A fetch refuses a file other than the pinned one (retried first). It then refuses another header, a body that does not end with a line break or whose last row is short (each arm tested), another row count, and rows of another width or with an empty name past their shares. Each share is tested at its shipped 1/100: accepted at 1 of 100 rows, refused at 2. The corpus is not fielded, so it is read through
snapshot.py --local, notlocal_agreement.py.Docs. The new source has a row and a paragraph in
tools/differential/README.md, and is added to its other corpus lists and toconfig_diff.py's group lists and help. In rootAGENTS.md, theopensanctions-parliamentsparagraph gains a newly dated figure (the older dated ones are kept), and "Validating a new parsing rule" gains a sentence saying which changes readmy-candidates.Verified
uv run pytest: 50,421 passed.uv run pytest -n0 -m serial: 38 passed.uv run mypyanduv run ruff checkare clean. Each new test passes alone with-n0.MY_MAX_BADraised, a test fails each time. Counting nameless per cell (the pre-fix form) fails the new per-row test.own_cache. The shared cache was written only by the intended real fetch of both corpora (my-candidates<1s,opensanctions-parliaments49s).Review
PR review toolkit aspects run:
bumiputeralabelled as Malay, and the nameless share counted per cell where the docs say per row. All were fixed in the second commit.--grouplist (the help text) and a wrong "family last" note on the one mixed-case record. Both were fixed in the third commit.Type-design review does not apply: the only new type is a frozen record of pins.
Refers to #1465, which stays open.
🤖 Generated with Claude Code