Skip to content

feat: add Nord Pool Auction API client as day-ahead price fallback - #14

Merged
tommed merged 3 commits into
mainfrom
claude/nord-pool-api-fallback-OyVxO
Apr 7, 2026
Merged

tommed merged 3 commits into
mainfrom
claude/nord-pool-api-fallback-OyVxO

Conversation

@tommed

@tommed tommed commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Adds NordPoolAuctionClient using the Auction API (client_auction_api / auction_api scope), available to all DA trading members without a separate Market Data subscription.

Key changes:

  • nordpool.py: new NordPoolAuctionClient class with QH auction ID construction (closeForBidDate = D-1), response parser for the contracts array format, and hourly aggregation of 96 QH values
  • client.py: renames NORDPOOL_USERNAME/PASSWORD env vars to NORDPOOL_MARKETDATA_* and adds NORDPOOL_AUCTION_* pair; inserts _nordpool_auction as second source in _SOURCES (Market Data > Auction > ENTSO-E priority); DE_LU excluded from auction zone set until CWE TSO area codes are confirmed
  • tests: 41 new tests for NordPoolAuctionClient (token, auction ID construction, area/currency filtering, QH aggregation, NA values, error mapping) and updated test_client.py for renamed params plus new routing tests; 99% coverage
  • docs/nordpool.md: new Auction API section with schema, product ID table, resolution notes, and 7-day retention caveat
  • README.md / .env.example: updated credential env var names

https://claude.ai/code/session_013iRZCCs7dhYXEfyyWK1fAH

Adds NordPoolAuctionClient using the Auction API (client_auction_api /
auction_api scope), available to all DA trading members without a
separate Market Data subscription.

Key changes:
- nordpool.py: new NordPoolAuctionClient class with QH auction ID
  construction (closeForBidDate = D-1), response parser for the
  contracts array format, and hourly aggregation of 96 QH values
- client.py: renames NORDPOOL_USERNAME/PASSWORD env vars to
  NORDPOOL_MARKETDATA_* and adds NORDPOOL_AUCTION_* pair; inserts
  _nordpool_auction as second source in _SOURCES (Market Data >
  Auction > ENTSO-E priority); DE_LU excluded from auction zone set
  until CWE TSO area codes are confirmed
- tests: 41 new tests for NordPoolAuctionClient (token, auction ID
  construction, area/currency filtering, QH aggregation, NA values,
  error mapping) and updated test_client.py for renamed params plus
  new routing tests; 99% coverage
- docs/nordpool.md: new Auction API section with schema, product ID
  table, resolution notes, and 7-day retention caveat
- README.md / .env.example: updated credential env var names

https://claude.ai/code/session_013iRZCCs7dhYXEfyyWK1fAH
@tommed tommed self-assigned this Apr 7, 2026
mypy infers df.index as Index[Any] (the generic base) which doesn't
expose .floor(). Wrapping with pd.DatetimeIndex() makes the type
explicit and satisfies the type checker.

https://claude.ai/code/session_013iRZCCs7dhYXEfyyWK1fAH
@codecov

codecov Bot commented Apr 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…lient

Adds two tests that exercise the previously uncovered lines introduced
by this PR: naive deliveryStart timestamps are treated as UTC, and
start > end yields an empty DataFrame without making HTTP requests.

https://claude.ai/code/session_013iRZCCs7dhYXEfyyWK1fAH
@tommed
tommed merged commit 9851c6f into main Apr 7, 2026
2 checks passed
@tommed
tommed deleted the claude/nord-pool-api-fallback-OyVxO branch April 7, 2026 08:34
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