{"id":25024819,"url":"https://github.com/gmasse/ecactus-ecos-py","last_synced_at":"2026-02-14T02:34:57.027Z","repository":{"id":272084272,"uuid":"915091651","full_name":"gmasse/ecactus-ecos-py","owner":"gmasse","description":"Python client library for eCactus ECOS API","archived":false,"fork":false,"pushed_at":"2025-03-22T21:59:26.000Z","size":698,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T15:14:14.388Z","etag":null,"topics":["api-client","battery-management-system","ecactus","ecos","energy-management","python","solar-panels","weiheng"],"latest_commit_sha":null,"homepage":"http://g.masse.me/ecactus-ecos-py/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmasse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2025-01-11T00:20:21.000Z","updated_at":"2025-03-22T21:39:50.000Z","dependencies_parsed_at":"2025-03-02T01:22:27.294Z","dependency_job_id":null,"html_url":"https://github.com/gmasse/ecactus-ecos-py","commit_stats":null,"previous_names":["gmasse/ecactus-ecos","gmasse/ecactus-ecos-py"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmasse%2Fecactus-ecos-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmasse%2Fecactus-ecos-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmasse%2Fecactus-ecos-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmasse%2Fecactus-ecos-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmasse","download_url":"https://codeload.github.com/gmasse/ecactus-ecos-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251684190,"owners_count":21627089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","battery-management-system","ecactus","ecos","energy-management","python","solar-panels","weiheng"],"created_at":"2025-02-05T16:32:19.910Z","updated_at":"2026-02-14T02:34:52.002Z","avatar_url":"https://github.com/gmasse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eCactus ECOS Python Client\n[![ci](https://github.com/gmasse/ecactus-ecos-py/actions/workflows/ci.yml/badge.svg)](https://github.com/gmasse/ecactus-ecos-py/actions/workflows/ci.yml)\n\nThis Python client provides both synchronous and asynchronous interfaces to interact with the eCactus ECOS platform from WEIHENG Group for energy management. However, **this project is in its early stages, is not fully tested, and is not safe for production use**. Use it at your own risk.\n\n\n## Features\n\n- **Synchronous Access**: Use the `Ecos` class for straightforward, blocking operations.\n- **Asynchronous Access**: Use the `AsyncEcos` class for non-blocking, concurrent operations.\n\n## Installation\n\n```bash\npython -m venv venv\nsource venv/bin/activate\npip install ecactus-ecos-py\n```\n\n## Usage\n\n### Synchronous Client\n\n```python\nfrom ecactus import Ecos\n\n# Initialize the client\nsession = Ecos(datacenter='EU')\nsession.login('email@domain.com', 'mypassword')\n\n# Fetch user details\nuser = session.get_user()\nprint(user)\n\n# Retrieve all the devices\ndevices = session.get_all_devices()\nprint(devices)\n```\n\n### Asynchronous Client\n\n```python\nimport asyncio\nfrom ecactus import AsyncEcos\n\nasync def main():\n    # Initialize the client\n    session = AsyncEcos(datacenter='EU')\n    await session.login('email@domain.com', 'mypassword')\n\n    # Fetch user details\n    user = await session.get_user()\n    print(user)\n\n    # Retrieve all the devices\n    devices = await session.get_all_devices()\n    print(devices)\n\nasyncio.run(main())\n```\n\n## Examples\n\nA set of ready-to-use scripts is available in the `examples/` directory.\n\n## Documentation\n\nThe API references for both `Ecos` and `AsyncEcos` clients, is available at:\n**[eCactus ECOS API Client Documentation](https://g.masse.me/ecactus-ecos-py/api)**\n\n## Development \u0026 Contributing\n\nTo set up the project for development, clone the repository and install dependencies:\n```\ngit clone https://github.com/gmasse/ecactus-ecos-py.git\ncd ecactus-ecos-py\npython -m venv venv\nsource venv/bin/activate\npython -m pip install '.[dev]'\n```\n\nWe invite you to contribute to the project by opening an issue or pull request to propose new features, fix bugs, or enhance the documentation.\n\nFor pending tasks and improvements, please check the [TODO.md](TODO.md) file.\n\n### Automatic Synchronous Code Generation\n\nThe `ecactus.Ecos` synchronous class, defined in [src/ecactus/client.py](src/ecactus/client.py), is **automatically generated** from the `ecactus.AsyncEcos` class using [scripts/unasync.py](scripts/unasync.py). When making changes to the `ecactus.AsyncEcos` class, you should re-run this script to regenerate the `ecactus.Ecos` class:\n```\npython scripts/unasync.py\n```\n\nThis ensures that both the synchronous and asynchronous APIs remain consistent.\n\nTo verify that the generated synchronous class matches the asynchronous class, use the `--check` option:\n```\npython scripts/unasync.py --check\n```\nThis will report any differences between the two classes, allowing you to catch any inconsistencies before submitting your changes.\n\n### Code Quality\n\n- **Linting**: Run `ruff` to check for code style issues:\n  ```bash\n  ruff check\n  ```\n- **Typing Checks**: Use `mypy` to ensure type correctness:\n  ```bash\n  mypy\n  ```\n- **Unit Tests**: Run `pytest` to execute tests:\n  ```bash\n  pytest\n  ```\n\n### Documentation Contribution\n\nUse mkdocs to serve a local preview of the documentation:\n```\nmkdocs serve\n```\n\n## License\n\nThis project is licensed under the GPL-3.0 License. See the [LICENSE](LICENSE) file for details.\n\n## ⚠️ Disclaimer\n\n- This project is **not affiliated with, endorsed by, or associated with WEIHENG Group, eCactus, ECOS, or any related companies**.\n- The names *WEIHENG*, *eCactus*, and *ECOS* may be **registered trademarks** of their respective owners.\n- This software is developed **independently** and does not interact with any proprietary or official services provided by WEIHENG Group or eCactus.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmasse%2Fecactus-ecos-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmasse%2Fecactus-ecos-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmasse%2Fecactus-ecos-py/lists"}