VigiEauPy
Asynchronous Python client for the VigiEau API, the official French service for monitoring water use restrictions during drought periods.
Installation
pip install vigieaupy
Requirements
- Python >= 3.10
- aiohttp >= 3.8.1
Usage
import asyncio
from vigieaupy import Consommateur, Source, VigiEau, VigiEauException
async def main():
api = VigiEau()
try:
# Search for a commune by name or postal code
communes = await api.async_get_cog(name="Nantes")
# or: communes = await api.async_get_cog(codeZip=44000)
# Fetch active water restrictions
restrictions = await api.async_get_data(
codeInsee=communes[0]["code"],
source=Source.AEP,
consommateur=Consommateur.particulier,
)
for restriction in restrictions:
print(restriction)
except VigiEauException as err:
print(f"Error: {err}")
finally:
await api.async_close()
asyncio.run(main())
API
VigiEau(session=None, timeout=120)
Main client class. Optionally accepts an existing aiohttp.ClientSession and a timeout in seconds.
async_get_cog(codeZip=None, name=None)
Search for communes using the French government API (geo.api.gouv.fr).
| Parameter | Type | Description |
|---|---|---|
codeZip |
int |
5-digit postal code |
name |
str |
Commune name (3 characters minimum) |
Returns a list of matching communes.
async_get_data(codeInsee, source=None, consommateur=None)
Fetch active water restrictions for a commune.
| Parameter | Type | Description |
|---|---|---|
codeInsee |
str |
INSEE code of the commune |
source |
Source |
Water resource type (optional) |
consommateur |
Consommateur |
Consumer profile (optional) |
Enum Source
| Value | Description |
|---|---|
Source.AEP |
Tap water |
Source.SUP |
Rivers and streams |
Source.SOU |
Groundwater (wells or boreholes) |
Enum Consommateur
| Value | Description |
|---|---|
Consommateur.particulier |
Individual |
Consommateur.exploitation |
Agricultural operation |
Consommateur.entreprise |
Professional |
Consommateur.collectivite |
Local authority |
Exceptions
| Exception | Description |
|---|---|
VigiEauException |
Base client exception |
HttpRequestError |
API communication error |
TimeoutExceededError |
Request timed out |
RequestException |
HTTP error returned by the API |
License
GPL-3.0-or-later — see the LICENSE file.
Metadata
Release files for vigieaupy 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vigieaupy-1.2.0.tar.gz | 22.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vigieaupy-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.0 kB
Release files / vigieaupy-1.2.0.tar.gz
| Download URL | vigieaupy-1.2.0.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afddeffb2ccdd14d35d317036c107906d19b374ddc2da9229b9d620f6d25fee1
|
|
BLAKE2b-256 checksum How to use checksums |
dae3d981008551826cf8a137135bc6d55df1c3bece97909c68d986d1c7f95994
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.
Transparency logRelease files / vigieaupy-1.2.0-py3-none-any.whl
| Download URL | vigieaupy-1.2.0-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a09cc77983fea369eebd516ee9f36912c3ba8fe4364a8c181e691f100d337f8
|
|
BLAKE2b-256 checksum How to use checksums |
39f75fa6eda70c243d3789879f892047eae39e4ea0f39f8a230236b32edc962a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.
Transparency log