Skip to content
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

Wi p pollingstations refactor #11

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Conversation

GeoWill
Copy link
Contributor

@GeoWill GeoWill commented Jun 12, 2021

Port of https://github.com/wdiv-scrapers/dc-base-scrapers

Rational is to only have maintain one set of tooling/checks/deployment stuff around scraping 'types of thing' from multiple councils.
We will have to do this quite well for the reps work, so we might as well reap the benefits for polling stations - which neede some love anyway.

@GeoWill GeoWill force-pushed the WiP-pollingstations-refactor branch 2 times, most recently from 693ffb8 to d6a29c3 Compare June 14, 2021 11:30
Our current scraping model deals with all the stations and all the
districts, so for now I'm just going to reimplement that here. If
there's some advantage to scraping individual stations/districts that
can be handled down the line.
@GeoWill GeoWill force-pushed the WiP-pollingstations-refactor branch from d6a29c3 to e8d89c0 Compare June 14, 2021 11:34
from lgsf.path_utils import load_scraper, load_council_info


class Command(PerCouncilCommandBase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like a large chunk of this file could be refactored in to a common file - it's largely the same as the councillors one, and it would be good to keep the outputs and interfaces as similar as we can I think.

This can be an issue of course, not needed for this PR

from lgsf.polling_stations.scrapers.xml_scrapers import GmlScraper


class Scraper(GmlScraper):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I think this is really nice and readable. Not convinced that having two classes (PollingScraper and DistrictsScraper) would be any easier for a developer to work on. There might be other reasons to have them of course.

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.

2 participants