No project description provided
Project description
How to use
Provide user documentation here.
Installation
To install rws_waterinfo, do:
pip install rws-waterinfo
Run tests (including coverage) with:
pip install -r requirements-dev.txt
python setup.py test
Example
Get observation data from Waterinfo Here we retrieve observation data from Waterinfo. It takes in three arguments, two of which are optional, and returns a Pandas dataframe or None. The first argument, params, is a list of lists that contains the necessary parameters to retrieve observations. The second argument, filepath, is an optional string that specifies the directory and file name where the data will be saved. If filepath is not specified, the data will not be saved. The third argument, return_df, is an optional boolean that specifies whether the function should return the observations as a Pandas dataframe or not. If return_df is set to False, the function will not return anything.
import pandas as pd
import rws_waterinfo as rw
# Initialize rws_waterinfo library
#
params = [['OW', 'm3/s', 156, 'Q', 'OLST', 711556.219876449,
5803627.64455833, '2022-01-01', '2023-01-01']]
filepath = 'observations.csv'
#
data = rw.get_data(params=params, filepath=filepath, return_df=True)
#
print(data.head())
#
# Locatie_MessageID Coordinatenstelsel ... WaardeBewerkingsmethode.Code
WaardeBewerkingsmethode.Omschrijving
# 0 18878 25831 ... NaN NaN
# 1 18878 25831 ... NaN NaN
# 2 18878 25831 ... NaN NaN
# 3 18878 25831 ... NaN NaN
# 4 18878 25831 ... NaN NaN
# [5 rows x 54 columns]
This function sends a request to Waterinfo for parameter information and parses the response into a Pandas DataFrame. The DataFrame contains the locations and parameters combined into a single table.
import pandas as pd
# Initialize rws_waterinfo library
import rws_waterinfo as rw
#
catalog = rw.get_catalog()
#
catalog.head()
#
# AquoMetaData_MessageID Locatie_MessageID Coordinatenstelsel X Y
# 0 12746 22317 25831 717567.392073 5.782901e+06
# 1 17619 22366 25831 706152.313357 5.725423e+06
# 2 7941 17613 25831 580241.163781 5.723650e+06
# 3 14352 21173 25831 705635.738484 5.835367e+06
# 4 18676 21173 25831 705635.738484 5.835367e+06
# 5 rows × 44 columns
#
License
Copyright (c) 2023, Rijkswaterstaat
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rws_waterinfo-0.1.1.tar.gz
.
File metadata
- Download URL: rws_waterinfo-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20d8a95391c0e30e924fe7b8e32c700a28675dc738b11a286ff98fda9cfe45bd |
|
MD5 | 8c59a2cd495094ae74ef3f18e1752e15 |
|
BLAKE2b-256 | 55c8c88110e0d22ce39e407acf383d20b25d5cbc704586aa208badfffbdab13c |
File details
Details for the file rws_waterinfo-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: rws_waterinfo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cad5aa8a22ed2528ee7a9d57cd3e2c39e9eeaf0503ac247bbb210d8d07c7a30 |
|
MD5 | ad6c0d71829a4ca77389b81b8478921d |
|
BLAKE2b-256 | 4d00fbde1189caef71a1c3fd56bfbe6bb58da22a19f6b781f64156c75d35a309 |