Python library for Hypontech Cloud API
Project description
Hypontech Cloud API Python Library
A Python library for interacting with the Hypontech Cloud API for solar inverter monitoring.
Features
- Async/await support using aiohttp
- Get plant overview data (power, energy production, device status)
- Get plant list
- Get plant monitor data (real-time energy, power, earnings, environmental impact)
- Get inverter list for each plant
- Get administrator information
- Automatic token management and refresh
- Built-in retry logic for rate limiting
- Type hints for better IDE support
- Comprehensive error handling
Installation
pip install hyponcloud
Quick Start
Basic Usage
import asyncio
from hyponcloud import HyponCloud
async def main():
# Create client with your credentials
async with HyponCloud("your_username", "your_password") as client:
# Connect and authenticate
await client.connect()
# Get overview data
overview = await client.get_overview()
print(f"Current power: {overview.power}W")
print(f"Today's energy: {overview.e_today}kWh")
print(f"Total energy: {overview.e_total}kWh")
# Get plant list
plants = await client.get_list()
print(f"Number of plants: {len(plants)}")
# Get inverters for a specific plant
if plants:
inverters = await client.get_inverters(plants[0].plant_id)
print(f"Number of inverters: {len(inverters)}")
for inverter in inverters:
print(f" {inverter.model}: {inverter.power}W")
# Get real-time monitor data for a specific plant
if plants:
monitor = await client.get_monitor(plants[0].plant_id)
print(f"Today's energy: {monitor.e_today}kWh")
print(f"Total earnings: {monitor.total_earning} {monitor.monetary}")
# Get administrator information
admin = await client.get_admin_info()
print(f"Admin user: {admin.username}")
print(f"Email: {admin.email}")
asyncio.run(main())
Using with Custom aiohttp Session
import aiohttp
from hyponcloud import HyponCloud
async def main():
async with aiohttp.ClientSession() as session:
client = HyponCloud("your_username", "your_password", session=session)
await client.connect()
overview = await client.get_overview()
print(f"Power: {overview.power}W")
asyncio.run(main())
Configuring Retries
You can configure retry behavior globally at the client level, or override it per method call:
from hyponcloud import HyponCloud
async def main():
# Set global retries to 5 for all API calls
async with HyponCloud("username", "password", retries=5) as client:
await client.connect()
# Uses 5 retries (global setting)
overview = await client.get_overview()
# Override for specific call (uses 1 retry)
plants = await client.get_list(retries=1)
# Disable retries for this call
admin = await client.get_admin_info(retries=0)
asyncio.run(main())
Error Handling
from hyponcloud import (
HyponCloud,
RequestError,
AuthenticationError,
RateLimitError,
)
async def main():
try:
async with HyponCloud("username", "password") as client:
await client.connect()
overview = await client.get_overview()
print(f"Power: {overview.power}W")
except AuthenticationError as e:
print(f"Authentication failed: {e}")
except RateLimitError as e:
print(f"Rate limit exceeded: {e}")
except RequestError as e:
print(f"Connection error: {e}")
asyncio.run(main())
API Reference
See API.md for the full API reference.
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/jcisio/hyponcloud.git
cd hyponcloud
# Install development dependencies
pip install -e ".[dev]"
# Set up pre-commit hooks (optional but recommended)
pre-commit install
Running Tests
pytest
Code Formatting
ruff check .
ruff format .
Type Checking
mypy hyponcloud
Version Management
This project uses setuptools-scm for automatic version management:
- Versions are automatically determined from git tags
- Use semantic versioning (e.g.,
v0.1.2) - Create a git tag and push to trigger automated publishing via GitHub Actions
git tag v0.1.2
git push origin v0.1.2
Requirements
- Python 3.11+
- aiohttp 3.8.0+
- mashumaro 3.11+
Build Requirements
- setuptools-scm 8.0+ (automatically installed during build for version management)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Disclaimer
This library is not officially associated with or endorsed by Hypontech. Use at your own risk.
Support
For issues, questions, or contributions, please visit the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyponcloud-0.9.2.tar.gz.
File metadata
- Download URL: hyponcloud-0.9.2.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dae9c89f2e0a08a1f3744f5cbf26c68b0505e79399f083badf1a28ed03e1106
|
|
| MD5 |
65bf073d257319470192c1e82ba29ae4
|
|
| BLAKE2b-256 |
24f399bb6a48f8b941aa4cc6bbb836f279d700e548a849c15448da694cfa2bd4
|
Provenance
The following attestation bundles were made for hyponcloud-0.9.2.tar.gz:
Publisher:
publish.yml on jcisio/hyponcloud
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyponcloud-0.9.2.tar.gz -
Subject digest:
9dae9c89f2e0a08a1f3744f5cbf26c68b0505e79399f083badf1a28ed03e1106 - Sigstore transparency entry: 1217835440
- Sigstore integration time:
-
Permalink:
jcisio/hyponcloud@26813dc982ac4663d747e412787c7445bf51b1fc -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/jcisio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@26813dc982ac4663d747e412787c7445bf51b1fc -
Trigger Event:
push
-
Statement type:
File details
Details for the file hyponcloud-0.9.2-py3-none-any.whl.
File metadata
- Download URL: hyponcloud-0.9.2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4811a449aa836e33ba8f563d7000283a5a73fd97b135ee921ec5388a350eec4
|
|
| MD5 |
ce1414ae2a5fc0d8a03d9eff0d6f3309
|
|
| BLAKE2b-256 |
e3683a65632287a63ea06f8c6885b3b32912f316c67c088a2187e7e6cdf2568d
|
Provenance
The following attestation bundles were made for hyponcloud-0.9.2-py3-none-any.whl:
Publisher:
publish.yml on jcisio/hyponcloud
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyponcloud-0.9.2-py3-none-any.whl -
Subject digest:
b4811a449aa836e33ba8f563d7000283a5a73fd97b135ee921ec5388a350eec4 - Sigstore transparency entry: 1217835447
- Sigstore integration time:
-
Permalink:
jcisio/hyponcloud@26813dc982ac4663d747e412787c7445bf51b1fc -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/jcisio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@26813dc982ac4663d747e412787c7445bf51b1fc -
Trigger Event:
push
-
Statement type: