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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aguasgo_py-2026.7.2.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.2.tar.gz
Algorithm Hash digest
SHA256 385f1d000b4565281b6648d0237ffec2007b90201ceca180962a0c6487d4bdcd
MD5 3ccf0dece0b4a00fb0b43241c9ea6471
BLAKE2b-256 c723581bee32e966aa37caefc39942bafbf777412193d774f7ad4fd99395241b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aguasgo_py-2026.7.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: aguasgo_py-2026.7.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 23602220460bf77b09e2589ff31340c2222c3d5c087c5ffec1a43e6ef672e036
MD5 f1a95f26dadb11511b22084b52211ae0
BLAKE2b-256 ff89f4776c208c3f6aa7b1109f7a5908129a72654a7cf774de09033aa126abfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for aguasgo_py-2026.7.2-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