feat(factor): add energy_irpc (IRPC net margin) as 2nd Thai refiner signal

- new energy_irpc collector parsing IRPC performance-highlights table
  (net profit/EBITDA/ROE margins, latest period 3M26: +10.27%)
- factor energy_irpc_net_margin (sign +1) wired into refining_energy/
  exploration/utilities, extending the energy theme beyond TOP
- scheduler job + dashboard fetch + sources table row (now 9 sources)
- tests: parse (incl paren-negatives), value-key resolution, direction;
  suite 368 OK. Independent review passed: true
- Phase B feasibility: REIC/EPPO/NBTC/PTTEP are JS-rendered or anti-bot
  (recorded deferred in plan); IRPC was the clean server-rendered win
This commit is contained in:
Kunthawat Greethong
2026-08-29 11:13:17 +07:00
parent da671a9ba2
commit 12b34929d7
14 changed files with 309 additions and 24 deletions

View File

@@ -75,19 +75,23 @@ Each is a collector + FACTORS entry ×N + THEME wiring + tests.
- Factor: `consumer_confidence` (sign +1).
- Feasibility: spike — some sources require login; fallback to TradingEconomics "consumer confidence".
## Phase B — sector-specific (IMPLEMENTED 2026-08-29 via TradingEconomics single-page snapshots)
## Phase B — sector-specific (IMPLEMENTED 2026-08-29 via single-page snapshots)
### B1. Property: `te_property_prices` (residential property prices % YoY) — DONE, feeds property theme
### B2. Utilities: EPPO electricity — DEFERRED (no clean single-page TE snapshot; needs EPPO scraper)
### B3. Energy breadth: PTT/PTTEP/BCP quarterly — DEFERRED (needs company-IR scrapers, heavier)
### B3. Energy breadth: `energy_irpc` (IRPC net margin, 3M26 +10.27%) — DONE, feeds refining_energy/exploration/utilities
### B4. Telecom/backdrop: `te_business_confidence` — DONE, feeds telecom_it + property + healthcare
### B5. Healthcare: consumer/business backdrop wired in — DONE (macro + business confidence)
Both added to the existing `te_thailand.py` module (2 extra TE pages) — same reviewed pattern, +2 factors, +4 tests.
Added to `te_thailand.py` + new `energy_irpc.py`, same reviewed pattern. Full suite 368.
## Remaining backlog (needs dedicated scrapers, not single-page snapshots)
- REIC property transfer/housing supply (TH-specific, richer than a TE index)
- EPPO electricity demand/generation for utilities
- PTT/PTTEP/BCP/IRPC quarterly financials (beyond TOP) for energy breadth
- NBTC subscriber/data for a true telecom-specific series
## Deferred / blocked by feasibility (2026-08-29 spike results — all JS-rendered or anti-bot)
- **REIC** (property transfer): JS SPA, data loads via XHR — not plain-HTML scrapable.
Would need browser_exec or `har-derived-api-client` (XHR reverse-engineering).
- **EPPO** (utilities electricity): WordPress/JS pages, no static numeric table.
- **NBTC** (telecom data): HTTP 403 anti-bot block.
- **PTTEP** (energy): JS shell (no server-rendered tables); PTT/BCP URLs 404/DNS.
Only **IRPC** among the energy names exposed a server-rendered financial table.
These are NOT quick plain-HTML collectors — they need a browser/XHR approach or a
logged-in/authorized session. Do them as a separate effort if the analysis needs
them, not as simple additions to this collector family.
---