Skip to main content

Python client for unofficial Global Omnium water API

Project description

Aguasgo-py Python API

GitHub Release CodeQL Code style: black

Programmatic access to water consumption data from Global Omnium, the Spanish water distributor management group.

🚀 Features

  • Multi-entity Support: Compatible with various Global Omnium management companies (e.g., Emivasa, Aguas de Valencia, and others).
  • Automatic Municipality → Base URL Detection: Enter your municipality during setup; the library resolves the correct API endpoint automatically.
  • Modern Python: Fully updated for Python 3.11+ with strong type hinting and asynchronous support (asyncio / aiohttp).
  • Consumption Data: Retrieve current readings and hourly/historical consumption.
  • Historical Backfill: Fetch complete historical data in chunks (30-day windows) for Home Assistant Energy Dashboard integration.
  • Reliable: Robust parsing and session management designed for stable Home Assistant integrations.

📦 Installation

For Development (Editable Mode)

If you are contributing or developing a component based on this library, install it in editable mode:

git clone https://github.com/carlos-48/aguasgo-py.git
cd aguasgo-py
pip install -e .

For Production

pip install aguasgo-py

🛠️ Quick Start

import asyncio
import aiohttp
from aguasgo import Client

async def main():
    async with aiohttp.ClientSession() as session:
        # base_url is mandatory as it depends on the management company of your municipality
        client = Client(
            session=session,
            username="your_username",
            password="your_password",
            base_url="https://www.emivasa.es/VirtualOffice"
        )
        
        # Example: Get current measure
        measure = await client.get_measure()
        print(f"Current Reading: {measure.accumulate} m³")
        print(f"Instant Consumption: {measure.instant} l/h")

asyncio.run(main())

🧪 Testing

The library includes a comprehensive test suite using pytest.

Unit Tests

Run fast, deterministic tests using local fixtures:

pytest tests/unit

Integration Tests

Run tests against the live Global Omnium API (requires credentials):

pytest --run-integration tests/integration

⚖️ License & Attribution

This project is licensed under the GNU General Public License v3.0 (GPLv3).

Attribution Notice: This library is based on the original work by ldotlopez, adapted, refactored, and updated by carlos-48 to migrate from electrical energy data (original project) to water supply data.

🔗 Useful Links

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

aguasgo_py-2026.7.0.tar.gz (83.1 kB view details)

Uploaded Source

Built Distribution

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

aguasgo_py-2026.7.0-py3-none-any.whl (85.0 kB view details)

Uploaded Python 3

File details

Details for the file aguasgo_py-2026.7.0.tar.gz.

File metadata

  • Download URL: aguasgo_py-2026.7.0.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for aguasgo_py-2026.7.0.tar.gz
Algorithm Hash digest
SHA256 4dabd2d411f6845a5f5c34fc77540fba389b052a74db4de58897d2f936690428
MD5 67bd711a8635f4adfd7a4abd29b3bfe4
BLAKE2b-256 df0f87f0887e7d60d0faf01dc0160ad2b75899fc5c0ff2df4496617c356ced73

See more details on using hashes here.

File details

Details for the file aguasgo_py-2026.7.0-py3-none-any.whl.

File metadata

  • Download URL: aguasgo_py-2026.7.0-py3-none-any.whl
  • Upload date:
  • Size: 85.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for aguasgo_py-2026.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 811c03327a4f28bfea1d17f6ade6d8813efdbf5171ede9b80efdd2e1ca41c9d9
MD5 6170eebbf313baaad8e17627d4bcb53b
BLAKE2b-256 856843e6fdd167b06d822119bbeaf3545e58806db5c4bcac17050a80e4a0a73e

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