Skip to content

Conversation

@m4dm4rtig4n
Copy link
Contributor

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

  • New scraper: VattenfallScraper with PDF parsing capability and automatic fallback to hardcoded pricing data
  • Pricing support: BASE (18.72 cts€/kWh) and HC/HP (19.94 HP / 15.71 HC cts€/kWh)
  • Power levels: 3, 6, 9, 12, 15, 18, 24, 30, 36 kVA with dynamic subscription pricing
  • Auto-registration: Scraper automatically appears in /admin/offers provider list on first access
  • 18 offers generated: 9 BASE + 9 HC/HP tariff combinations

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings December 5, 2025 08:06
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>
@m4dm4rtig4n m4dm4rtig4n merged commit f06de22 into main Dec 5, 2025
5 checks passed
Copy link

Copilot AI left a 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)
Copy link

Copilot AI Dec 5, 2025

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)

Suggested change
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)

Copilot uses AI. Check for mistakes.
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)
Copy link

Copilot AI Dec 5, 2025

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
@m4dm4rtig4n m4dm4rtig4n deleted the vattenfall-scraper branch December 18, 2025 07:59
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