energyid-py
Async Python client for the EnergyID API.
Installation
pip install EnergyID
Quick Start
import asyncio
from energyid import JSONClient
async def main():
async with JSONClient(api_key="YOUR_API_KEY") as client:
member = await client.get_member()
records = await client.get_member_records()
meters = await client.get_record_meters(records[0].id)
readings = await client.get_meter_readings(meters[0].id, take=10)
print(member["fullName"], len(readings["readings"]))
asyncio.run(main())
Authentication
from energyid import JSONClient
# API Key (recommended)
client = JSONClient(api_key="YOUR_API_KEY")
# Device Token
client = JSONClient(device_token="YOUR_DEVICE_TOKEN")
# OAuth2
client = JSONClient(
client_id="ID",
client_secret="SECRET",
username="user@example.com",
password="pass",
)
Built-in Request Throttling
JSONClient includes two safeguards to reduce backend pressure:
max_concurrency: max in-flight HTTP requests.max_requests_per_window+rate_limit_window_seconds: request-rate cap.
Defaults are conservative (max_concurrency=10, max_requests_per_window=20, rate_limit_window_seconds=1.0).
client = JSONClient(
api_key="YOUR_API_KEY",
max_concurrency=5,
max_requests_per_window=10,
rate_limit_window_seconds=1.0,
)
Set max_concurrency=None and/or max_requests_per_window=None to disable a limiter.
PandasClient
Use PandasClient for DataFrame/Series output:
import asyncio
from energyid import PandasClient
async def main():
async with PandasClient(api_key="YOUR_API_KEY") as client:
df = await client.get_meter_readings(meter_id="meter-id", take=100)
ts = await client.get_record_data(
record_id=123,
name="electricityImport",
start="2024-01-01",
end="2024-12-31",
interval="month",
)
print(df.shape, ts.shape)
asyncio.run(main())
API Documentation
License
MIT
Metadata
Release files for EnergyID 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| energyid-1.0.0.tar.gz | 157.7 kB | Without provenance | Details for energyid-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| energyid-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for energyid-1.0.0-py3-none-any.whl |
Total release size: 176.5 kB
Release files / energyid-1.0.0.tar.gz
| Download URL | energyid-1.0.0.tar.gz |
|---|---|
| Size | 157.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0763cd80f3bc3e5144023d17f3cf096622b8770f80235294858ab91747a46707
|
|
BLAKE2b-256 checksum How to use checksums |
f012704d461473e8121eccf14c25190697dd02ade1b0aa103be44ee7a74dda6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.17
|
Release files / energyid-1.0.0-py3-none-any.whl
| Download URL | energyid-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
baa6d483a535eb87f392903329beb6f1e1bb9cb40382c4c66ffaa2554aff4515
|
|
BLAKE2b-256 checksum How to use checksums |
28a4ad254f1b973b1300cb4836ddf45cc231845ff4e96eef3bda6e26b584baf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.17
|
Security for EnergyID 1.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.