Skip to main content

Async client for eGauge energy monitor (https://www.egauge.net)

Project description

Egauge-Async

asyncio APIs for communicating with eGauge meters.

Examples

Get current rates

import asyncio
from egauge_async import EgaugeClient

async def get_current_rates():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    current_readings = egauge.get_current_rates()
    print(current_readings)

asyncio.run(get_current_rates())

Get weekly changes over the last 4 weeks

import asyncio
from egauge_async import EgaugeClient

async def get_weekly_changes():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    weekly_changes = egauge.get_weekly_changes(num_weeks=4)
    print(weekly_changes)

asyncio.run(get_weekly_changes())

Get available registers

import asyncio
from egauge_async import EgaugeClient

async def get_registers():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    instantaneous_registers = egauge.get_instantaneous_registers()j
    print(instantaneous_registers)
    historical_registers = egauge.get_historical_registers()
    print(historical_registers)

asyncio.run(get_historical_registers())

Implementation Details

This package uses the publically-documented XML API provided by eGauge Systems. It also provides support for the newer JSON API with JWT authentication.

Testing

The project includes both unit tests and integration tests:

Running Tests

# Run all unit tests (default)
uv run pytest

# Run with coverage
uv run pytest --cov=egauge_async

# Run integration tests (requires real eGauge device)
export EGAUGE_HOST="egauge12345.local"
export EGAUGE_USERNAME="owner"
export EGAUGE_PASSWORD="your_password"
uv run pytest -m integration

Integration tests validate functionality against a real eGauge device and are automatically skipped if the required environment variables (EGAUGE_HOST, EGAUGE_USERNAME, EGAUGE_PASSWORD) are not set.

Disclaimer

This project is not affiliated with, endorsed by, or sponsored by eGauge Systems LLC. Any product names, logos, brands, or other trademarks are the property of their respective trademark holders.

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

egauge_async-0.5.0.tar.gz (98.6 kB view details)

Uploaded Source

Built Distribution

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

egauge_async-0.5.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file egauge_async-0.5.0.tar.gz.

File metadata

  • Download URL: egauge_async-0.5.0.tar.gz
  • Upload date:
  • Size: 98.6 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":true}

File hashes

Hashes for egauge_async-0.5.0.tar.gz
Algorithm Hash digest
SHA256 162968d1875f8d282f800a536db3384061524e2c148edef97431ad83a1006780
MD5 0322c410e09bddb2aeeaa9a81e2c2b5c
BLAKE2b-256 3a0c09a24dad95d65c9babd828cd2402a2438c6bd176a3e66d5f711406f9f105

See more details on using hashes here.

File details

Details for the file egauge_async-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: egauge_async-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 32.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":true}

File hashes

Hashes for egauge_async-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 debd96ca8cab69f1ba6a1dbb32d1369616174d27a20192ccf0d4657a49a33e56
MD5 f0e4a5ec2530b3807ef21af7da4623bf
BLAKE2b-256 2cfb50da16d2b61ee42e775c281d69c78e8dfa2fccc4c258278a7323bf17e6d3

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