NetzOOEeServiceAPI
from netzooe_eservice_api import NetzOOEeServiceAPI
class NetzOOEeServiceAPI(username: str, password: str, *, session: ClientSession | None = None)
Asynchronous client for the Netz OÖ eService API.
The client logs in automatically on the first request and again once if the session has expired.
Parameters
- username
str: Username of the eService portal. - password
str: Password of the eService portal. - session
ClientSession | None(default:None): Optional aiohttp client session. A passed session is never closed by the client. If no session is passed, the client creates its own and closes it onlogout()and if a login fails.
Example
async with ClientSession() as session:
client = NetzOOEeServiceAPI(
username="test",
password="test",
session=session,
)
headers
client.headers: dict[str, str]
Headers for all API requests, including the current XSRF token.
login
async def login() -> None
Log in to the eService portal and get a new XSRF token.
Calling this method is optional, the client logs in automatically on the first request. Concurrent calls and automatic logins share one login and its result. If the session is still logged in, the client logs out and logs in again.
Raises
AuthenticationError: The credentials were rejected (HTTP 401).APIError: Any other HTTP or connection error, or the session response contains no XSRF token.
logout
async def logout() -> None
Log out from the eService portal and reset the XSRF token.
If the client created its own session, the session is closed. The XSRF token is reset and the session
is closed even if the logout request fails. A running login is cancelled and raises an APIError.
Raises
APIError: The logout request failed with an HTTP or connection error.
dashboard
async def dashboard() -> dict[str, Any]
Get the dashboard data, e.g. business partners and contract accounts.
Returns
dict[str, Any]: Raw JSON response of the dashboard.
Raises
AuthenticationError: The credentials were rejected (HTTP 401), also after a new login.InvalidJsonError: The response is not valid JSON, e.g. the maintenance page ("Wartungsseite").APIError: Any other HTTP or connection error.
Example
dashboard = await client.dashboard()
dashboard["contractAccounts"]
dashboard_headers
async def dashboard_headers(
branch: ConsumptionsProfilesBranch | Iterable[ConsumptionsProfilesBranch] | None = None,
*,
active_only: bool | None = None,
) -> list[dict[str, Any]]
Get a short overview of the contract accounts with their contracts and points of delivery.
Parameters
- branch
ConsumptionsProfilesBranch | Iterable[ConsumptionsProfilesBranch] | None(default:None): Only return contract accounts of this branch or these branches. Returns all contract accounts ifNone, empty or both branches. - active_only
bool | None(default:None): Only return active (True) contract accounts. Returns all contract accounts ifNone.
Returns
list[dict[str, Any]]: Raw JSON response of the dashboard headers.
Raises
AuthenticationError: The credentials were rejected (HTTP 401), also after a new login.InvalidJsonError: The response is not valid JSON, e.g. the maintenance page ("Wartungsseite").APIError: Any other HTTP or connection error, or a filter value that is no member of the filter's enum.
Example
headers = await client.dashboard_headers(active_only=True)
headers[0]["contracts"][0]["meterPointAdministrationNumber"]
consents
async def consents(
status: ConsentsStatus | Iterable[ConsentsStatus] | None = None,
/,
) -> list[dict[str, Any]]
Get the data sharing consents.
Parameters
- status
ConsentsStatus | Iterable[ConsentsStatus] | None(default:None): Only return consents with this status or one of these statuses. Returns all consents ifNoneor empty.
Returns
list[dict[str, Any]]: Raw JSON response of the consents.
Raises
AuthenticationError: The credentials were rejected (HTTP 401), also after a new login.InvalidJsonError: The response is not valid JSON, e.g. the maintenance page ("Wartungsseite").APIError: Any other HTTP or connection error, or a filter value that is no member of the filter's enum.
Example
await client.consents([ConsentsStatus.ACTIVE, ConsentsStatus.ACTIVE_UNCHANGEABLE])
consent_requests
async def consent_requests(
status: ConsentRequestsStatus | Iterable[ConsentRequestsStatus] | None = None,
/,
) -> list[dict[str, Any]]
Get the data sharing consent requests, e.g. of energy communities.
Parameters
- status
ConsentRequestsStatus | Iterable[ConsentRequestsStatus] | None(default:None): Only return consent requests with this status or one of these statuses. Returns all consent requests ifNoneor empty.
Returns
list[dict[str, Any]]: Raw JSON response of the consent requests.
Raises
AuthenticationError: The credentials were rejected (HTTP 401), also after a new login.InvalidJsonError: The response is not valid JSON, e.g. the maintenance page ("Wartungsseite").APIError: Any other HTTP or connection error, or a filter value that is no member of the filter's enum.
Example
await client.consent_requests(ConsentRequestsStatus.CONFIRMED)
consumptions_profiles
async def consumptions_profiles(
branch: ConsumptionsProfilesBranch | Iterable[ConsumptionsProfilesBranch] | None = None,
*,
active_only: bool | None = None,
) -> list[dict[str, Any]]
Get the consumption profiles of all points of delivery.
Parameters
- branch
ConsumptionsProfilesBranch | Iterable[ConsumptionsProfilesBranch] | None(default:None): Only return profiles of this branch or these branches. Returns all profiles ifNone, empty or both branches. - active_only
bool | None(default:None): Only return profiles of active (True) points of delivery. Returns all profiles ifNone.
Returns
list[dict[str, Any]]: Raw JSON response of the consumption profiles.
Raises
AuthenticationError: The credentials were rejected (HTTP 401), also after a new login.InvalidJsonError: The response is not valid JSON, e.g. the maintenance page ("Wartungsseite").APIError: Any other HTTP or connection error, or a filter value that is no member of the filter's enum.
Example
await client.consumptions_profiles(ConsumptionsProfilesBranch.ELECTRICITY, active_only=True)
contract_accounts
async def contract_accounts(
business_partner_number: str,
contract_account_number: str,
) -> dict[str, Any]
Get the data of a contract account.
Parameters
- business_partner_number
str: Business partner number, e.g. fromdashboard(). - contract_account_number
str: Contract account number, e.g. fromdashboard().
Returns
dict[str, Any]: Raw JSON response of the contract account.
Raises
AuthenticationError: The credentials were rejected (HTTP 401), also after a new login.InvalidJsonError: The response is not valid JSON, e.g. the maintenance page ("Wartungsseite").APIError: Any other HTTP or connection error.
Example
await client.contract_accounts(
business_partner_number="1234567890",
contract_account_number="123456789012",
)
consumptions_profile
async def consumptions_profile(
pods: list[Pod],
dimension: ConsumptionsDimension = ConsumptionsDimension.ENERGY,
) -> list[dict[str, Any]]
Get the consumption profile of one or more points of delivery.
Parameters
- pods
list[Pod]: Points of delivery and the time range to request. - dimension
ConsumptionsDimension(default:ConsumptionsDimension.ENERGY): Measurement dimension of the values.
Returns
list[dict[str, Any]]: Raw JSON response of the consumption profile.
Raises
AuthenticationError: The credentials were rejected (HTTP 401), also after a new login.InvalidJsonError: The response is not valid JSON, e.g. the maintenance page ("Wartungsseite").APIError: Any other HTTP or connection error, adimensionthat is noConsumptionsDimensionmember, or aPodvalue that is neither a member of its enum nor a string.
Example
await client.consumptions_profile(
pods=[
Pod(
contract_account_number="123456789012",
profile_type=ProfileType.ACTIVE_CURRENT,
best_available_granularity=Granularity.QUARTER_OF_AN_HOUR,
meter_point_administration_number="AT0031000000000000000000000000000",
date_from="...",
date_to="...",
),
],
dimension=ConsumptionsDimension.ENERGY,
)

