https://github.com/pklaus/luftdruck-hessen
Scrape official air pressure values in Hesse published by the Hessian Agency for the Environment and Geology, called HLUG.
https://github.com/pklaus/luftdruck-hessen
Last synced: 3 months ago
JSON representation
Scrape official air pressure values in Hesse published by the Hessian Agency for the Environment and Geology, called HLUG.
- Host: GitHub
- URL: https://github.com/pklaus/luftdruck-hessen
- Owner: pklaus
- Created: 2015-01-14T23:36:57.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-12T10:52:42.000Z (about 10 years ago)
- Last Synced: 2024-12-28T15:48:54.472Z (5 months ago)
- Language: Python
- Homepage: http://www.hlug.de/no_cache/messwerte/luft/meteorologie/luftdruck.html
- Size: 133 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Luftdruck Hessen
================This tool scrapes the web page of the *Hessian Agency for the Environment and Geology*
offering the air pressure in different cities in an HTML table:
["Aktuelle Luftdruck-Messwerte"][luftdruck].The Python tool scrapes the site, extracts the values for a given city
and prints the output in JSON, CSV, or Python dictionary format.Example Usage
-------------To get the values for "Fürth/Odenwald", run the script like this
python scraper.py --format csv "Fürth/Odenwald"
an you will get this:
# Time, Air Pressure
00:00, 1009.0
00:30, 1009.0
[...]
09:00, 1012.0
09:30, 1011.0
10:00, nan
10:30, 1012.0
11:00, 1012.0
11:30, 1012.0
[...]
22:00, 1016.0
22:30, 1016.0
23:00, 1016.0
23:30, 1016.0Check [the web page][luftdruck] for other possible city names.
Requirements
------------To run this script, you need Python (tested with Python 3) and the modules
requests and beautifulsoup4, both of which you can install with `pip`.Remarks
-------If the HTML code of the site was better organized, you could parse it with Pandas in Python like this:
import pandas as pd
pressure_url = 'http://www.hlug.de/no_cache/messwerte/luft/meteorologie/luftdruck.html'
dfs = pd.read_html(pressure_url)Author
------Philipp Klaus
[luftdruck]: http://www.hlug.de/no_cache/messwerte/luft/meteorologie/luftdruck.html