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.

  • 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.1

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.1
File Size Uploaded Provenance
aiobudgetthuis-0.1.1.tar.gz 19.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 32.8 kB

Release files / aiobudgetthuis-0.1.1.tar.gz

Download URL aiobudgetthuis-0.1.1.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6af5ca810f9173368284a959c98d5c2d81a6cf388bebd37246d1f525747981d7
BLAKE2b-256 checksum
How to use checksums
f08a832b6d36dcd4de52520e8f6a23a53d7c7023f6782325e84f83a5a3cf46d4
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 29, 2026.

Transparency log

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

Download URL aiobudgetthuis-0.1.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2faa6afa3bc41bc1245058ec452a83cbb0686c8aa447806ad486759883b1a8dc
BLAKE2b-256 checksum
How to use checksums
3985b72436c044cf62f7cace3500ef4de0b8c856340b316869e2c892df25be22
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 29, 2026.

Transparency log

Security for aiobudgetthuis 0.1.1

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.1.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 29, 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.1 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