{"id":20500284,"url":"https://github.com/josermorales/pyosmanager","last_synced_at":"2026-01-28T14:03:35.300Z","repository":{"id":245762999,"uuid":"819067455","full_name":"JoseRMorales/pyOSManager","owner":"JoseRMorales","description":"Python client for Open Surplus Manager API","archived":false,"fork":false,"pushed_at":"2024-11-20T18:12:35.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T05:53:45.786Z","etag":null,"topics":["api-client","iot","pypi","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoseRMorales.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-23T17:23:42.000Z","updated_at":"2024-11-20T18:12:35.000Z","dependencies_parsed_at":"2024-11-15T18:21:14.990Z","dependency_job_id":"53f6d0cd-5791-4534-8f6d-2b51709259c4","html_url":"https://github.com/JoseRMorales/pyOSManager","commit_stats":null,"previous_names":["josera9/pyosmanager"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/JoseRMorales/pyOSManager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseRMorales%2FpyOSManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseRMorales%2FpyOSManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseRMorales%2FpyOSManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseRMorales%2FpyOSManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoseRMorales","download_url":"https://codeload.github.com/JoseRMorales/pyOSManager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseRMorales%2FpyOSManager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","iot","pypi","python"],"created_at":"2024-11-15T18:20:23.513Z","updated_at":"2026-01-28T14:03:30.292Z","avatar_url":"https://github.com/JoseRMorales.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyOSManager\n\n\u003e Python client for Open Surplus Manager\n\nThis repo is about the Python client, for info about Open Surplus Manager see the project [repository](https://github.com/JoseRMorales/OpenSurplusManager)\n\n## Installation\n\n```bash\npip install pyosmanager\n```\n\n## Usage\n\n```python\nimport asyncio\n\nfrom pyosmanager import OSMClient\nfrom pyosmanager.responses import DeviceResponse\n\n\nasync def main():\n    async with OSMClient(\"http://localhost:8080\") as client:\n        res = await client.get_devices()\n        d: DeviceResponse\n        for d in res:\n            print(d.name)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n```\n\n## Methods\n\n- `is_healthy() -\u003e bool`\n\nTrue if the server is healthy\n\n- `get_core_state() -\u003e dict`\n\nRetrieve the core state\n\n- `get_devices() -\u003e list[DeviceResponse]`\n\nRetrieve a list of devices\n\n- `get_device(device_name: str) -\u003e DeviceResponse`\n  \nRetrieve a device data dictionary by name\n\n- `get_device_consumption(device_name: str) -\u003e float`\n  \nRetrieve the device consumption by name\n\n- `get_surplus() -\u003e float:`\n\nRetrieve the surplus value\n\n- `set_surplus_margin(margin: float) -\u003e float:`\n  \nSet the surplus margin\n\n- `set_grid_margin(margin: float) -\u003e float:`\n\nSet the grid margin\n\n- `set_idle_power(idle_power: float) -\u003e float:`\n\nSet the idle power\n\n- `set_device_max_consumption(device_name: str, max_consumption: float) -\u003e float:`\n\nSet the max consumption for a device\n\n- `set_device_expected_consumption(device_name: str, expected_consumption: float) -\u003e float:`\n\nSet the expected consumption for a device\n\n- `set_device_cooldown(device_name: str, cooldown: int) -\u003e int:`\n\nSet the cooldown for a device\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosermorales%2Fpyosmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosermorales%2Fpyosmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosermorales%2Fpyosmanager/lists"}