Skip to main content

No project description provided

Project description

kilowahti-py

Pure-Python library for Nordic/Baltic electricity spot pricing. Powers the Kilowahti Home Assistant integration and can be used independently in any Python project.

Installation

pip install kilowahti

Requires Python 3.12+ and aiohttp 3.9+.

Quick example

import asyncio
import aiohttp
from kilowahti import SpotHintaSource, PriceResolution, spot_effective

async def main():
    source = SpotHintaSource()
    async with aiohttp.ClientSession() as session:
        slots = await source.fetch_today(session, region="FI", resolution=PriceResolution.HOUR)

    vat_rate = 0.255  # 25.5% Finnish VAT
    for slot in slots:
        price = spot_effective(slot, vat_rate=vat_rate, commission=0.0)
        print(f"{slot.dt_utc.strftime('%H:%M')}  rank {slot.rank:2d}  {price:.2f} c/kWh")

asyncio.run(main())

What's in the box

Module Contents
kilowahti.models Data classes: PriceSlot, TransferGroup, FixedPeriod, ScoreProfile, …
kilowahti.calc Pure calculation functions — pricing, ranking, control factors, scoring
kilowahti.sources PriceSource ABC and SpotHintaSource (spot-hinta.fi) implementation
kilowahti.const API URLs, region list, country VAT presets, unit constants

Everything public is re-exported from the top-level kilowahti namespace:

from kilowahti import PriceSlot, SpotHintaSource, cheapest_window, COUNTRY_PRESETS

Supported regions

FI, EE, LT, LV, DK1, DK2, NO1NO5, SE1SE4

Documentation

Full API reference at docs.kilowahti.fi/lib

License

MIT — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kilowahti-2026.7.0.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kilowahti-2026.7.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file kilowahti-2026.7.0.tar.gz.

File metadata

  • Download URL: kilowahti-2026.7.0.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kilowahti-2026.7.0.tar.gz
Algorithm Hash digest
SHA256 84b7cd74ad7940221be27a2b71711065416cc48f38f1d569362e0a7f774868b9
MD5 9b89a1a29af461e98572dc003bd79e28
BLAKE2b-256 47cb5f894a0516abd9095c6a515c52c0e8fab18e914b28aa1f49ef8548e2ab29

See more details on using hashes here.

File details

Details for the file kilowahti-2026.7.0-py3-none-any.whl.

File metadata

  • Download URL: kilowahti-2026.7.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kilowahti-2026.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2efbdf48d132962df13d5b531fb404c0f945f70fe146eb1a9eeac8ea4ce778f0
MD5 bc36da3e6766ca7b01405f170262f1b3
BLAKE2b-256 96beab13196556f448bcba6f5c0b212c40d773b86b3f868fc00f33f1b5dbbfb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page