Skip to main content

Python client for Open Surplus Manager

Project description

pyOSManager

Python client for Open Surplus Manager

Installation

pip install pyosmanager

Usage

import asyncio

from pyosmanager import OSMClient


async def main():
    async with OSMClient("http://localhost:8080") as client:
        print(await client.get_devices())


if __name__ == "__main__":
    asyncio.run(main())

Methods

  • is_healthy() -> bool

True if the server is healthy

  • get_devices() -> list[DeviceResponse]

Retrieve a list of devices

  • get_device(device_name: str) -> DeviceResponse

Retrieve a device data dictionary by name

  • get_device_consumption(device_name: str) -> float

Retrieve the device consumption by name

  • get_surplus() -> float:

Retrieve the surplus value

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

pyosmanager-0.1.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

pyosmanager-0.1.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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