-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Vattenfall energy provider scraper #68
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
Conversation
Implement price scraper for Vattenfall's "Électricité Verte Équilibre" offer with support for BASE and HC/HP tariffs across all power levels (3-36 kVA). - Add VattenfallScraper class with PDF parsing and fallback pricing data - Register scraper in PriceUpdateService and __init__ exports - Support both BASE (flat rate) and HC/HP (off-peak/peak) pricing options - All prices include VAT (TTC) as per official tariffs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5a7b329 to
245484a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a new Vattenfall energy provider scraper to the system, integrating their "Électricité Verte Équilibre" pricing. The scraper follows the established PDF-based pattern used by other providers (AlpIQ, Enercoop, etc.) with PDF parsing capabilities and automatic fallback to hardcoded pricing data when PDF parsing fails. The implementation supports both BASE and HC/HP tariff options across all standard power levels (3-36 kVA), generating 18 offers total.
Key changes:
- New VattenfallScraper class with PDF parsing and fallback mechanism
- Support for BASE (single rate) and HC/HP (peak/off-peak) pricing structures
- Automatic registration in the scraper system via init.py
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/api/src/services/price_scrapers/vattenfall_scraper.py | Complete implementation of VattenfallScraper with PDF parsing, price extraction methods, fallback data, and validation logic for 18 Vattenfall electricity offers |
| apps/api/src/services/price_scrapers/init.py | Added VattenfallScraper import and export to make it available in the scraper system |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| We extract the TTC prices from "Offre Vattenfall" columns. | ||
| """ | ||
| offers = [] | ||
| valid_from = datetime.now(UTC).replace(day=1, hour=0, minute=0, second=0, microsecond=0) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The valid_from date should use a specific datetime that matches when the pricing became valid (August 1, 2025 according to the fallback data comments), not datetime.now(UTC). This ensures consistency and accuracy.
Should be: valid_from = datetime(2025, 8, 1, 0, 0, 0, 0, tzinfo=UTC)
| valid_from = datetime.now(UTC).replace(day=1, hour=0, minute=0, second=0, microsecond=0) | |
| valid_from = datetime(2025, 8, 1, 0, 0, 0, 0, tzinfo=UTC) |
| def _get_fallback_offers(self) -> List[OfferData]: | ||
| """Generate offers from fallback pricing data""" | ||
| offers = [] | ||
| valid_from = datetime.now(UTC).replace(day=1, hour=0, minute=0, second=0, microsecond=0) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The valid_from date should use a specific datetime that matches the fallback data's effective date (as documented in the comments: "Tarifs en vigueur à compter du 1er août 2025"), not datetime.now(UTC). This ensures consistency across runs and accurately represents when the pricing became valid.
Should be: valid_from = datetime(2025, 8, 1, 0, 0, 0, 0, tzinfo=UTC)
This pattern is used consistently in other scrapers like AlpiqScraper and EkwateurScraper.
| valid_from = datetime.now(UTC).replace(day=1, hour=0, minute=0, second=0, microsecond=0) | |
| valid_from = datetime(2025, 8, 1, 0, 0, 0, 0, tzinfo=UTC) |
Summary
Integrate Vattenfall's "Électricité Verte Équilibre" pricing into the energy provider scraper system. The scraper extracts both BASE and HC/HP tariff options across all power levels (3-36 kVA).
Implementation Details
VattenfallScraperwith PDF parsing capability and automatic fallback to hardcoded pricing data/admin/offersprovider list on first access🤖 Generated with Claude Code