Skip to main content

This library provides access to the Wasserschutzpolizei Zurich live (using this REST API) and historic (using these CSV files) weather data.

Install

This package builds on Python 3.

sudo pip3 install fhnw_ds_hs2019_weatherstation_api

Download Historic Data

mkdir data && cd data
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_mythenquai_2007-2018.csv
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_tiefenbrunnen_2007-2018.csv
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_mythenquai_2019.csv
wget https://raw.githubusercontent.com/markif/WeatherStation_HS2019/master/data/messwerte_tiefenbrunnen_2019.csv
cd ..

Usage

You need to run this code with Python 3 and make sure you adapt config.historic_data_folder based on your environment.

#!/usr/bin/env python3

# import the library
from fhnw_ds_hs2019_weatherstation_api import data_import as weather
import os

# DB and CSV config
config = weather.Config()
# define CSV path (you need to define this based on your environment)
config.historic_data_folder='.'+os.sep+'data'
# set batch size for DB inserts (decrease for raspberry pi)
config.historic_data_chunksize=10000
# define DB host
config.db_host='localhost'

# connect to DB
weather.connect_db(config)
# clean DB
weather.clean_db(config)
# import historic data
weather.import_historic_data(config)
# import latest data (delta between last data point in DB and current time)
weather.import_latest_data(config)

Metadata

Release files for fhnw-ds-hs2019-weatherstation-api 0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for fhnw-ds-hs2019-weatherstation-api 0.21
File Interpreter ABI Platform Actions
fhnw_ds_hs2019_weatherstation_api-0.21-py3-none-any.whl Python 3 none any Details for fhnw_ds_hs2019_weatherstation_api-0.21-py3-none-any.whl

Release files / fhnw_ds_hs2019_weatherstation_api-0.21-py3-none-any.whl

Download URL fhnw_ds_hs2019_weatherstation_api-0.21-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7cc8990300fbe7c812d9d08e432cb984cae88cb05c365fb5758808e7b25c072
BLAKE2b-256 checksum
How to use checksums
84af533c9806c7b6a5fac9e9b8a4f08cbb7968d4a2486297c898dfe39b70a1ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3

Security for fhnw-ds-hs2019-weatherstation-api 0.21

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page