-
Notifications
You must be signed in to change notification settings - Fork 0
fix: implement Ekwateur HTML parsing and update Dec 2025 prices #57
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
…25 prices Replace stub _parse_html with actual BeautifulSoup-based HTML parsing to extract pricing from Ekwateur's website tables instead of always falling back to manual data. Update fallback prices to December 2025 and remove obsolete offers (Prix variable, VE) no longer available on their website. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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 PR implements actual HTML parsing for the Ekwateur electricity pricing scraper and updates fallback prices to December 2025 rates. The implementation replaces the stub _parse_html method with BeautifulSoup-based table parsing logic.
Key Changes:
- Added HTML parsing functionality using BeautifulSoup and regex to extract kWh and subscription prices from pricing tables
- Updated fallback prices from November to December 2025 with current market rates
- Removed discontinued offer types (variable pricing and electric vehicle special offers)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 6: {"subscription": 15.84, "hp": 0.17914, "hc": 0.1426}, | ||
| 9: {"subscription": 20.48, "hp": 0.17914, "hc": 0.1426}, |
Copilot
AI
Dec 4, 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.
Inconsistent HC (heures creuses) prices for 6 kVA and 9 kVA power levels. Line 30 shows hc: 0.14026 for 3 kVA, but lines 31-32 show hc: 0.1426 for 6 and 9 kVA. This appears to be a typo - the HC price should likely be consistent across power levels or the values should be 0.14026 instead of 0.1426.
| 6: {"subscription": 15.84, "hp": 0.17914, "hc": 0.1426}, | |
| 9: {"subscription": 20.48, "hp": 0.17914, "hc": 0.1426}, | |
| 6: {"subscription": 15.84, "hp": 0.17914, "hc": 0.14026}, | |
| 9: {"subscription": 20.48, "hp": 0.17914, "hc": 0.14026}, |
| try: | ||
| price = float(price_match.group(1)) | ||
| # kWh prices are typically between 0.10 and 0.50 | ||
| if 0.05 < price < 0.60: |
Copilot
AI
Dec 4, 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.
Magic numbers 0.05 and 0.60 used for kWh price validation lack explanation. Consider extracting these as named constants (e.g., MIN_KWH_PRICE = 0.05, MAX_KWH_PRICE = 0.60) with documentation explaining the acceptable price range.
| try: | ||
| price = float(price_match.group(1)) | ||
| # Subscription prices are typically between 10 and 50 €/month | ||
| if 5.0 < price < 60.0: |
Copilot
AI
Dec 4, 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.
Magic numbers 5.0 and 60.0 used for subscription price validation lack explanation. Consider extracting these as named constants (e.g., MIN_SUBSCRIPTION_PRICE = 5.0, MAX_SUBSCRIPTION_PRICE = 60.0) with documentation explaining the acceptable price range.
| if len(prices) >= 9: | ||
| data["base_3"] = prices[0] | ||
| data["base_6"] = prices[1] | ||
| data["base_9"] = prices[2] | ||
| data["hp_3"] = prices[3] | ||
| data["hp_6"] = prices[4] | ||
| data["hp_9"] = prices[5] | ||
| data["hc_3"] = prices[6] | ||
| data["hc_6"] = prices[7] | ||
| data["hc_9"] = prices[8] |
Copilot
AI
Dec 4, 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 hardcoded index-based price assignments assume a fixed order (Base 3/6/9, HP 3/6/9, HC 3/6/9) without verification. This is brittle and could silently assign wrong prices if the website's table structure changes. Consider adding validation comments or assertions to document the expected structure, or implement more robust parsing that identifies which column corresponds to which power level.
…ucture Update table detection logic to work with Ekwateur's actual HTML structure: - Look for "heures creuses" instead of "€/kWh" or "kWh" in table detection - Handle combined "heures pleines / heures creuses" header pattern - Add debug logging for parsed prices 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Test plan
🤖 Generated with Claude Code