Skip to main content

Async Python client for the EAC (Electricity Authority of Cyprus) Distribution Web Portal

Project description

eac-dso-portal

Async Python client for the EAC (Electricity Authority of Cyprus) Distribution Web Portal at meterreading-dso.eac.com.cy.

The portal exposes an undocumented JSON API behind a JWT-authenticated session. This package wraps it in a small aiohttp-based client with typed dataclasses.

Install

pip install eac-dso-portal

Requires Python 3.11+.

Usage

import asyncio
from datetime import datetime, timedelta, timezone
import aiohttp
from eac_dso_portal import EacClient

async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = EacClient("you@example.com", "password", session=session)
        await client.login()

        for sp in await client.list_service_points():
            if not sp.active:
                continue
            print(sp.id, sp.address)

            # Default channel(s) — typically the daily total kWh.
            end = datetime.now(timezone.utc)
            start = end - timedelta(days=14)
            for cr in await client.get_readings(sp.id, start, end):
                for r in cr.readings:
                    print(f"  {r.dt.isoformat()}  {r.reading} kWh (Δ {r.value})")

asyncio.run(main())

What's in the API

Method What it does
login() POST /api/portal/login → JWT, refreshed automatically on 401
get_user_details() Account holder name and admin flag
list_service_points() All service points on the account (active and historical)
get_meter_configs(sp_id) All meters ever installed at a service point, with their measurement-channel lists
get_readings(sp_id, start, end, mc_id=None) Readings in a date range; mc_id=None returns the default summary channels, an explicit mc_id returns one channel including 30-minute load-profile data

All return values are immutable dataclasses with .raw fallbacks for fields the wrapper does not yet model.

Errors

  • EacAuthError — login was rejected, or token refresh failed
  • EacRateLimitError — HTTP 429
  • EacApiError — any other non-2xx (with .status, .message, .path)
  • EacError — base class for all of the above

Status & scope

This is a thin wrapper around an undocumented portal API, primarily built to drive a Home Assistant integration (ha-eac on GitHub). The endpoint set and field names follow what the portal's React frontend uses today and are subject to change without notice on EAC's side. The package exposes a .raw payload on each model so consumers can read fields the wrapper has not yet promoted into typed attributes.

License

MIT

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

eac_dso_portal-0.1.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eac_dso_portal-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file eac_dso_portal-0.1.1.tar.gz.

File metadata

  • Download URL: eac_dso_portal-0.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for eac_dso_portal-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a1dbde8a6939ba074a3fe17925197b38245f3c890c2441bcb11b6cde1e9f1c4e
MD5 2f31047a7671f89b3e7431d9f5158265
BLAKE2b-256 0ec600a7f0c59e5866a6fa26eef6621235260cbce797c5d79ad44f713b3890e5

See more details on using hashes here.

File details

Details for the file eac_dso_portal-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: eac_dso_portal-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for eac_dso_portal-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a62c9669fb0731fc1c832a4528e7c453898d03c0c189960874db294d88a8df8c
MD5 5eae0e232c547ba0dfbf0fb40a15343b
BLAKE2b-256 45f8ea30356b055265dc73960ebbb5d94b0808c0735aea088cc7683847bcd4a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page