Skip to main content

Python package to download time series data from waterinfo.be

Project description

pywaterinfo

Python package to download time series data from waterinfo.be

Python package

Description

pywaterinfo facilitates access to waterinfo.be, a website managed by the Flanders Environment Agency (VMM) and Flanders Hydraulics Research. The website provides access to real-time water and weather related environmental variables for Flanders (Belgium), such as rainfall, air pressure, discharge, and water level. The package provides functions to search for stations and variables, and download time series.

Check out the documentation website for more information.

Installation

pip install pywaterinfo

Example

To initialize data requests from VMM, setup the Waterinfo class with vmm as input:

from pywaterinfo import Waterinfo
vmm = Waterinfo("vmm")

The time series provided by waterinfo are all defined by a unique identifier called ts_id. Each combination of a given variable (e.g. air pressure) measured at a given location (e.g. Overpelt) with a certain frequency (e.g. 15min) is defined by an ts_id identifier. Using such an identifier, one can download the data of a given period with the command get_timeseries_values(). For example, the 15min air pressure time series at Overpelt has identifier ts_id = 78124042. To get last day of data for the time series with ID 78124042:

df = vmm.get_timeseries_values(78124042, period="P1D")

pywaterinfo returns the data as a Pandas DataFrame, which provides functionlities to plot and manipulate the time series.

Requesting data from from HIC is very similar:


hic = Waterinfo("hic")

Get last day of data for the time series with ID 39496010, corresponding to high-resolution (5min) conductivity measurements in Dendermonde:

df = hic.get_timeseries_values(ts_id="39496010", period="P1D")

Next to the request of time series data for a given time series identifier, other requests are supported as well. These functions provide multiple ways to search for the ts_id you need to download certain data. See the documentation website for more info.

Note on restrictions of the downloads

The amount of data downloaded from waterinfo.be is limited via a credit system. You do not need to get a token right away to download data. For limited and irregular downloads, a token will not be required.

When you require more extended data requests, please request a download token from the waterinfo.be site administrators via the e-mail address hydrometrie@waterinfo.be with a statement of which data and how frequently you would like to download data. You will then receive a client-credit code that can be used to obtain a token that is valid for 24 hours, after which the token can be refreshed with the same client-credit code. The handling of this token is done by the package itself, but it is important to use the code when initializing the Waterinfo instance. For example, using a VMM token:

from pywaterinfo import Waterinfo
vmm_token = "YOUR TOKEN CODE"
vmm = Waterinfo("vmm",  token=vmm_token)

Contribute

Want to contribute code or functionalities to the pywaterinfo package? Great news! Check out the contributing guidelines and the development guidelines in the documentation website.

Acknowledgements

The package development and maintenance is supported by Fluves. Part of the initial development of this package has been supported by VITO.

This package is just a small wrapper around waterinfo.be to facilitate researchers and other stakeholders in downloading the data from waterinfo.be. The availability of this data is made possible by de Vlaamse Milieumaatschappij, Waterbouwkundig Laboratorium, Maritieme Dienstverlening & Kust, Waterwegen en Zeekanaal NV en De Scheepvaart NV.

Meta

  • We welcome contributions including bug reports.
  • License: MIT
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

This project has been set up using PyScaffold 3.2.3. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

pywaterinfo-0.5.1.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

pywaterinfo-0.5.1-py2.py3-none-any.whl (14.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pywaterinfo-0.5.1.tar.gz.

File metadata

  • Download URL: pywaterinfo-0.5.1.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for pywaterinfo-0.5.1.tar.gz
Algorithm Hash digest
SHA256 23802bcc37059b664af4c3d0824d6defba6b02964b170147b13fd3979c317a5f
MD5 78f9f1415a1b4ea34da638bd5c8704d1
BLAKE2b-256 02986aceed9b5ce64833d9ab4076d5e11b2f37c7f56592efd536e4ff346ef1f4

See more details on using hashes here.

File details

Details for the file pywaterinfo-0.5.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pywaterinfo-0.5.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for pywaterinfo-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d3f44444d2565d898bb1983d27d16be2c53a6c3a2598c8d57b938204b9521b55
MD5 99527f30f2d230cc34cce2538741e523
BLAKE2b-256 dd918866ced5911ad7c3831d9f16c8315269995832a18b04302e5ba47ff8fc46

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page