Skip to main content

Python client library for eCactus ECOS API

Project description

eCactus ECOS Python Client

ci

This 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.

Features

  • Synchronous Access: Use the Ecos class for straightforward, blocking operations.
  • Asynchronous Access: Use the AsyncEcos class for non-blocking, concurrent operations.

Installation

python -m venv venv
source venv/bin/activate
pip install git+https://github.com/gmasse/ecactus-ecos-py.git

Usage

Synchronous Client

from ecactus import Ecos

# Initialize the client
session = Ecos(datacenter='EU')
session.login('email@domain.com', 'mypassword')

# Fetch user details
user_info = session.get_user_info()
print(user_info)

# Retrieve all the devices
devices = session.get_all_devices()
print(devices)

Asynchronous Client

import asyncio
from ecactus import AsyncEcos

async def main():
    # Initialize the client
    session = AsyncEcos(datacenter='EU')
    await session.login('email@domain.com', 'mypassword')

    # Fetch user details
    user_info = await session.get_user_info()
    print(user_info)

    # Retrieve all the devices
    devices = await session.get_all_devices()
    print(devices)

asyncio.run(main())

Examples

A set of ready-to-use scripts is available in the examples/ directory.

Documentation

The API references for both Ecos and AsyncEcos clients, is available at: eCactus ECOS API Client Documentation

Development & Contributing

To set up the project for development, clone the repository and install dependencies:

git clone https://github.com/gmasse/ecactus-ecos-py.git
cd ecactus-ecos-py
python -m venv venv
source venv/bin/activate
python -m pip install '.[dev]'

We invite you to contribute to the project by opening an issue or pull request to propose new features, fix bugs, or enhance the documentation.

For pending tasks and improvements, please check the TODO.md file.

Code Quality

  • Linting: Run ruff to check for code style issues:
    ruff check
    
  • Typing Checks: Use mypy to ensure type correctness:
    mypy
    
  • Unit Tests: Run pytest to execute tests:
    pytest
    

Documentation Contribution

Use mkdocs to serve a local preview of the documentation:

mkdocs serve

License

This project is licensed under the GPL-3.0 License. See the LICENSE file for details.

⚠️ Disclaimer

  • This project is not affiliated with, endorsed by, or associated with WEIHENG Group, eCactus, ECOS, or any related companies.
  • The names WEIHENG, eCactus, and ECOS may be registered trademarks of their respective owners.
  • This software is developed independently and does not interact with any proprietary or official services provided by WEIHENG Group or eCactus.

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

ecactus_ecos_py-0.1.0.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

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

ecactus_ecos_py-0.1.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file ecactus_ecos_py-0.1.0.tar.gz.

File metadata

  • Download URL: ecactus_ecos_py-0.1.0.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ecactus_ecos_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e6501cb15a99f257fd34f2b60264cc1182611996e60aecbba2cb2b76b19c3ef
MD5 1a2f4bcb77e77e1d75196f9859d255b9
BLAKE2b-256 1d3c6a0ce44ae7a360ee4c0d510e1a838237fe05fe9cb267a4ffa50532025784

See more details on using hashes here.

File details

Details for the file ecactus_ecos_py-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ecactus_ecos_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b09b358eac322c1e28d6156334ade9bc992bdcc756d2b3eb76b567717a7e766d
MD5 104d711671bf4a902d3528f494920920
BLAKE2b-256 e8ff3d3663c2d62b30e986314ff0aa06635c301e7db5d0b2b31ae9a16b07ed55

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