Skip to main content

aiobudgetthuis

CI PyPI Python License: MIT

Async Python client for the unofficial Budget Thuis (Budget Energie) API: hourly dynamic electricity prices, daily usage/solar production/cost, monthly installment, free-energy windows, and contract discovery.

Unaffiliated. This project is not affiliated with, endorsed by, or supported by Budget Thuis / Budget Energie. The API is not publicly documented and may change or break at any time. "Budget Thuis" is a trademark of its respective owner.

Built for the ha-budget-thuis Home Assistant integration, but usable standalone in any asyncio application.

Install

pip install aiobudgetthuis

Requires Python 3.12+ and an aiohttp session managed by you.

Usage

import aiohttp

from aiobudgetthuis import BudgetThuisClient


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = BudgetThuisClient(session)

        # Login replays the server-rendered OAuth2 + PKCE form. Store only the
        # refresh token; never persist the password.
        tokens = await client.login("user@example.com", "password")

        contracts = await client.async_get_contracts(tokens.access_token)
        contract = next(c for c in contracts if c.is_active)

        from datetime import datetime, timedelta

        now = datetime.now().astimezone()
        details = await client.hourly_tariff(
            tokens.access_token, contract.id, now, now + timedelta(days=1)
        )
        for day in details.days:
            for tariff in day.electricity:
                print(tariff.period_from, tariff.total.gross)

Later sessions authenticate with await client.refresh(refresh_token).

API surface

  • login(username, password) / refresh(refresh_token) → Tokens
  • async_get_contracts(access_token) → list[Contract]
  • hourly_tariff(...) → HourlyTariffDetails (wrap in PriceData for derived values: current/next slot, daily min/max/average, forecast attributes)
  • usage_summary(...) → UsageSummary (per-day usage, solar production, cost, month-to-date)
  • monthly_amount(...) → MonthlyAmount (installment)
  • free_energy_status(...) → FreeEnergyStatus
  • contract_info(...) → ContractInfo
  • daily_reading_mandate(...) → Mandate

Errors: BudgetThuisAuthError (bad credentials / refused token) and BudgetThuisConnectionError (network / unexpected upstream response), both subclasses of BudgetThuisError.

Related projects

  • ha-budget-thuis — Home Assistant (HACS) integration built on this client.

Development

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
ruff check . && ruff format --check . && mypy src && pytest -q

License

MIT

Metadata

Release files for aiobudgetthuis 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiobudgetthuis 0.1.0
File Size Uploaded Provenance
aiobudgetthuis-0.1.0.tar.gz 18.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aiobudgetthuis 0.1.0
File Interpreter ABI Platform
aiobudgetthuis-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.0 kB

Release files / aiobudgetthuis-0.1.0.tar.gz

Download URL aiobudgetthuis-0.1.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2dfc438697039b2e60054c32df2e74361c676d604a6f625934e55c90f258e7f4
BLAKE2b-256 checksum
How to use checksums
ba8b1badaa35cbc64a6eb1793278e52353db2c1935792428b49b748406d64cf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / aiobudgetthuis-0.1.0-py3-none-any.whl

Download URL aiobudgetthuis-0.1.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
982e6eebc942931491ec5a1d49d82c292cce71816b0ef2b4124b009760230878
BLAKE2b-256 checksum
How to use checksums
38c2f6a3e06ed247a0784b6dbd4a063a3a60d8de1db6ff23c032ef4ca303e30e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Security for aiobudgetthuis 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiobudgetthuis-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page