| from abc import ABC, abstractmethod | |
| from datetime import date | |
| from legex.models.base import Case | |
| class BaseScraper(ABC): | |
| country: str | |
| def scrape( | |
| self, | |
| start_date: date | None = None, | |
| end_date: date | None = None, | |
| ) -> list[Case]: | |
| pass | |
| def civil_filter(cases: list[Case]) -> list[Case]: | |
| return list(cases) | |
| def enrich(cases: list[Case]) -> list[Case]: | |
| """Post-sampling enrichment hook — runs on the 130 sampled cases only. | |
| Default is a no-op. Scrapers that need expensive per-case work | |
| (e.g. downloading PDFs and extracting text) override this so the cost is | |
| paid only for the sampled set, not the full corpus. | |
| """ | |
| return list(cases) | |