Skip to content

v.1.0.0

Choose a tag to compare

@davitens davitens released this 04 Sep 10:09
· 6 commits to main since this release

A lightweight Python client for downloading historical water-quality and water-quantity data from SDIM, the data consultation service operated by the Agència Catalana de l'Aigua (ACA) (aplicacions.aca.gencat.cat/sdim21).

Disclaimer: This project is not affiliated with, endorsed by, or maintained by the ACA or the Generalitat de Catalunya. Use of the SDIM service is subject to the ACA's terms of use.

This client handles the session setup, form submission, and export parsing that the website normally does behind the scenes, returning clean pandas DataFrames ready for analysis.

What it does:

Authenticates automatically (no browser cookies or manual login).
Navigates the multi-step form flow (network → spatial filter → parameters → date range → export) using the same HTTP endpoints the web UI calls.
Parses the exported XLSX into a pandas DataFrame with date, station, value, quality flags, and metadata columns.
Resolves human-readable names (e.g. "Baix Empordà", "nitrate") to internal SDIM codes via a local metadata catalog, so you never need to figure out network IDs, subnetwork codes, or variable taxonomy yourself.

Install

git clone https://github.com/davitens/pySDIM.git
cd pySDIM
python -m pip install .

Dependencies: requests, pandas, openpyxl, lxml. Python ≥ 3.10.

The MIT-licensed client only talks to the public ACA website; it does not bundle or redistribute SDIM's data. Check the SDIM terms of use before using extracted data in a published work.