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.1.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.1-py3-none-any.whl (85.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aguasgo_py-2026.7.1.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aguasgo_py-2026.7.1.tar.gz
Algorithm Hash digest
SHA256 c89ef9878df26dc3e63b4639acdaf849e71d2a36c147317ae4ee95b8db07db53
MD5 df65024153376eeb37797c903338e14a
BLAKE2b-256 c0ca046352aa84542560a2bfc12a64a3eeb5b377b78b2460c98e44f1646f90a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aguasgo_py-2026.7.1.tar.gz:

Publisher: publish.yml on carlos-48/aguasgo-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: aguasgo_py-2026.7.1-py3-none-any.whl
  • Upload date:
  • Size: 85.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aguasgo_py-2026.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8f8a566fdfe5a5b13c9b60be932bf4808c6dc9ee949e3761490dbedcca89272
MD5 26efe4debdd741469f9e1a0d5ce59fe4
BLAKE2b-256 b15ea948c084e0b238fa9588af3e64c16107ecf6f3807aa72fd6c9507f630048

See more details on using hashes here.

Provenance

The following attestation bundles were made for aguasgo_py-2026.7.1-py3-none-any.whl:

Publisher: publish.yml on carlos-48/aguasgo-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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