Energy Tracker API Client
Async Python client for the Energy Tracker public REST API.
Installation
pip install energy-tracker-api
Requirements
- Python 3.14+
- Personal Access Token from Energy Tracker
Quick Start
import asyncio
from decimal import Decimal
from energy_tracker_api import EnergyTrackerClient, CreateMeterReadingDto
async def main():
async with EnergyTrackerClient(access_token="your-token") as client:
# List devices
devices = await client.devices.list_standard()
# Create a meter reading
reading = CreateMeterReadingDto(value=Decimal("12345.67"))
await client.meter_readings.create(
device_id="your-device-id",
meter_reading=reading,
)
asyncio.run(main())
Resources
The client exposes three resource groups — all endpoints, parameters, and DTOs are documented in the OpenAPI specification.
| Resource | Methods |
|---|---|
client.devices |
list_standard(), list_virtual() |
client.meter_readings |
list(), create(), delete(), export() |
client.environments |
list(), get(), create(), delete(), create_entry(), delete_entry() |
Configuration
client = EnergyTrackerClient(
access_token="your-token",
base_url="https://custom-api.example.com", # Optional
timeout=30, # Optional, default: 10s
)
Error Handling
All API errors inherit from EnergyTrackerAPIError and carry an api_message list with details from the server.
from energy_tracker_api import (
EnergyTrackerAPIError,
ValidationError,
AuthenticationError,
ForbiddenError,
ResourceNotFoundError,
ConflictError,
RateLimitError,
)
try:
await client.meter_readings.create(device_id, reading)
except RateLimitError as e:
print(f"Retry after {e.retry_after}s")
except EnergyTrackerAPIError as e:
print(e.api_message)
Development
make install-dev # Install dependencies
make test # Run tests
make type-check # mypy
make format # black + isort
make lint # Linters
License
MIT
Release files for energy-tracker-api 2.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 | |
|---|---|---|---|
| energy_tracker_api-2.0.0.tar.gz | 18.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| energy_tracker_api-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.3 kB
Release files / energy_tracker_api-2.0.0.tar.gz
| Download URL | energy_tracker_api-2.0.0.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3dc11fe68b460458eb76cf51d182ba7498fea53233b0a1fc6be1c80e98b6f139
|
|
BLAKE2b-256 checksum How to use checksums |
408eec074e78485d4b7fd3c5ec10c0aa2345d17c00032faf10ebf92c1b370f0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Feb 14, 2026.
Transparency logRelease files / energy_tracker_api-2.0.0-py3-none-any.whl
| Download URL | energy_tracker_api-2.0.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f8ff2fc7f3b07d0d49e854b1cd972cdc66c5d6cdb4ef6fc36511277a00d1a08
|
|
BLAKE2b-256 checksum How to use checksums |
bac27094b473a57611725c55e1159a54b6e5e17dae864497a014c6cce0a56966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Feb 14, 2026.
Transparency log