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.3.1.tar.gz (12.6 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.3.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kilowahti-2026.3.1.tar.gz
Algorithm Hash digest
SHA256 bc9bfb74937e93719f1356150ed7a835c317246f4dfa083b8029129f0b5cc114
MD5 107605842f451c9584ac7233082a1823
BLAKE2b-256 ad68c782df376d52367208ac6a060c3d0656ca27de13cde3113cd6748d827505

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kilowahti-2026.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b13be7bf82bdf406275d231c75fc4aa7b7b99a7844ec1034939cbdd52a1541a4
MD5 94ac6778f0056c87e74668156e2fdbbc
BLAKE2b-256 699055aa5b980c7eb7b69eb33a2f3d8ef9e7e295f1e33016191c880e5dbf9bff

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