Catalog PyPI
Back to packageRELEASE DETAILS

0.1.1

PyPI

aiobudgetthuis

Async Python client for the unofficial Budget Thuis (Budget Energie) API

asynciobudget-energiebudget-thuisdynamic-pricesenergy
Published29 Aug 2026
Direct dependencies6
Transitive dependenciesNot calculated

README

Version 0.1.1 documentation

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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
aiohttp
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
aiohttp>=3.9runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
mypy>=1.11; extra == "dev"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.25; extra == "dev"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov>=5; extra == "dev"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8; extra == "dev"runtime
ruff
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
ruff>=0.16.0; extra == "dev"runtime

Distribution files

2 collected
aiobudgetthuis-0.1.1-py3-none-any.whl

bdist_wheel · 12.93 KB · Python py3

Source file
aiobudgetthuis-0.1.1.tar.gz

sdist · 19.07 KB · Python source

Source file

Repository

PENDING
jdolieslager/aiobudgetthuis

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:42 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:936c3404fd0444a00e34ee79a32c8b53dd63f261d76ed7d9cd6bfee036e209ac

Other collected versions

View all collected versions →