Skip to content

Scrape amendment info #1143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Scrape amendment info #1143

wants to merge 2 commits into from

Conversation

tillprochaska
Copy link
Collaborator

@tillprochaska tillprochaska commented May 2, 2025

This is a first attempt at scraping amendment info (subject, number, authors) for votes. You can try this locally by running:

htv system upgrade
htv temp vot-lists
htv aggregate votes

What’s still missing is the normalization of amendment authors. Amendments can have multiple authors, and the official data sources don’t list them in a consistent/systematic way:

  • Newlines, commata, and spaces are all common as delimiters. Sometimes the delimiter is ambiguous.
  • Sometimes only "committee" is given as an author, in other cases it’s the 4-letter abbreviation of the committee (e.g. AGRI).
  • "MEPs"/"Members" is used interchangeably.

Ideally, I’d like to normalize this to something like this:

[
  {
    "type": "COMMITTEE",
    "committee": {
      "code": "AGRI",
      "label": "Committee on Agriculture and Rural Development",
      "abbreviation": "AGRI"
    }
  },
  {
    "type": "GROUP",
    "group": {
      "code": "EPP",
      "label": "European People\u2019s Party",
      "short_label": "EPP"
    }
  },
  {
    "type": "MEMBERS"
  }
]

For now, I’ve implemented very basic handling of authors which doesn’t handle all cases:

Screenshot 2025-05-02 at 3 09 05 PM

Just extracting some stuff from the main method into separate methods
to prepare for adding more stuff to this scraper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant