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, NO1–NO5, SE1–SE4
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kilowahti-2026.5.0.tar.gz.
File metadata
- Download URL: kilowahti-2026.5.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58cbeb651f928314ba709d1fcb7b833ad75520f2a00da156892ce5397ffea074
|
|
| MD5 |
536e95f0859c4a3d3c175593e5cb69e9
|
|
| BLAKE2b-256 |
47738394eb83970dfcb2e7adc98898ec67fa13ecc6101a6a712bc3110c99b166
|
File details
Details for the file kilowahti-2026.5.0-py3-none-any.whl.
File metadata
- Download URL: kilowahti-2026.5.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81ae0acc7d8a35d153abab05eace640e0680dd9a5a61bfba98d51adf832f7f36
|
|
| MD5 |
855af56bebf10036e1eabde7ab81671a
|
|
| BLAKE2b-256 |
14d304d840b3337d24b359b913e9bc5ad184f3553fe9753c5f271f45a7d41336
|