Skip to main content

Library voor communicatie met KNMI weer data.

Project description

Library to download KNMI weather data aggregated on a daily level or on an hourly level.

How to use

In order to download data on a daily level, use the following code below.

from rws_knmi_lib.knmi_downloader import import_daily_data

# Returns dataframe containing information on all KNMI stations.
df_daily = import_daily_data(start="20220501", end="20220505")

# Returns dataframe containing only information from the nearest KNMI station.
df_daily_nearest = import_daily_data(start="20220501", end="20220505",
                                     coord=(52.460770, 4.625110))

An example for obtaining hourly aggregated daily looks like this:

from rws_knmi_lib.knmi_downloader import import_hourly_data

# Returns dataframe containing information on all KNMI stations.
df_hourly = import_hourly_data(start="20220501", end="20220505")

# Returns dataframe containing only information from the nearest KNMI station.
df_hourly_nearest = import_hourly_data(start="20220501", end="20220505",
                                       coord=(52.460770, 4.625110))

Installation

To install rws-knmi-lib, do:

git clone https://gitlab.com/rwsdatalab/public/codebase/tools/rws-knmi-lib
cd rws-knmi-lib
pip install .

Run tests (including coverage) with:

pip install .[dev]
pytest

Documentation

Find the full documentation at https://rwsdatalab.gitlab.io/public/codebase/tools/rws-knmi-lib

License

Copyright 2022-2024 Rijkswaterstaat

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

rws-knmi-lib-1.0.1.tar.gz (10.2 kB view hashes)

Uploaded Source

Built Distribution

rws_knmi_lib-1.0.1-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

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