Skip to main content

Weatherstation API Client

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

Install

This package builds on Python 3.

sudo pip3 install fhnw_ds_weatherstation_client

Download Historic Data

mkdir data && cd data
wget https://raw.githubusercontent.com/jelleschutter/fhnw-ds-weatherstation-client/data/history/messwerte_mythenquai_2007-2019.csv
wget https://raw.githubusercontent.com/jelleschutter/fhnw-ds-weatherstation-client/data/history/messwerte_mythenquai_2020.csv
wget https://raw.githubusercontent.com/jelleschutter/fhnw-ds-weatherstation-client/data/history/messwerte_tiefenbrunnen_2007-2019.csv
wget https://raw.githubusercontent.com/jelleschutter/fhnw-ds-weatherstation-client/data/history/messwerte_tiefenbrunnen_2020.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 if necessary (default is ./data).

# import the library
import fhnw_ds_weatherstation_client 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)

Credits

Metadata

Release files for fhnw-ds-weatherstation-client 0.0.19

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

Source distribution (sdist)

Source distribution for fhnw-ds-weatherstation-client 0.0.19
File Size Uploaded
fhnw_ds_weatherstation_client-0.0.19.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fhnw-ds-weatherstation-client 0.0.19
File Interpreter ABI Platform
fhnw_ds_weatherstation_client-0.0.19-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / fhnw_ds_weatherstation_client-0.0.19.tar.gz

Download URL fhnw_ds_weatherstation_client-0.0.19.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6b4e250117e1076ee26175f9f790f08b9a4bc414614702bae36609055d18d0b0
BLAKE2b-256 checksum
How to use checksums
3e28e15ea2101b1f37ff535b766f1609a400634f9534a6f7cc4d170b0cacf765
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

Release files / fhnw_ds_weatherstation_client-0.0.19-py3-none-any.whl

Download URL fhnw_ds_weatherstation_client-0.0.19-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83c8b771fee3c3759b5e897d32eff5f90b044fea495fbcebe091d46e6f52c900
BLAKE2b-256 checksum
How to use checksums
083892449da8410e68f6afe7f6c956e34e9eecb5dffa373e83527f4825f81eeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

Release history Release notifications | RSS feed

This release

0.0.19 This release

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

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