A Python module to obtain and read Dutch weather data from Meteoserver.nl
Project description
Meteoserver
A Python module to obtain and read Dutch weather data from Meteoserver.nl. The code is being developped by Marc van der Sluys of the department of Sustainable energy of the HAN University of Applied Sciences in Arnhem, the Netherlands.
Installation
This package can be installed using pip install meteoserver
. This should automatically install the
dependency packages pandas
and requests
, if they haven't been installed already. If you are installing by
hand, ensure that these packages are installed as well.
You will need to obtain a (free) account and API key at Meteoserver.nl to download data from the Meteoserver API.
Example use
"""Example Python script using the Meteoserver module."""
import meteoserver as meteo
myKey = 'a123456789' # My Meteoserver API key - put your OWN key here!
myLocation = 'De Bilt' # My location
# Weather forecast #################################################################################
# Print some help:
meteo.print_help_uurverwachting()
location = 'Unknown' # Ensure we always have a location 'name' to write to file.
# Read weather-forecast data from file:
# data = meteo.read_json_file_uurverwachting('UurVerwachting1.json', full=True) # Option 1: HARMONIE/HiRLAM (48 (42?) hours)
# data = meteo.read_json_file_uurverwachting('UurVerwachting2.json') # Option 2: GFS (4/10 days), useful columns only, no location
# data, location = meteo.read_json_file_uurverwachting('UurVerwachting2.json', full=True, loc=True) # Option 2, with ALL columns and location
# Get weather-forecast data from server:
# data = meteo.read_json_url_uurverwachting(myKey, myLocation, model='HARMONIE') # Option 1: HARMONIE/HiRLAM
# data = meteo.read_json_url_uurverwachting(myKey, myLocation) # Option 2 (default): GFS, useful columns only, no location
data, location = meteo.read_json_url_uurverwachting(myKey, myLocation, full=True, loc=True) # Option 2, with ALL columns and location
# Print the data:
print(data)
# Write the downloaded data to a json file:
meteo.write_json_file_uurverwachting('UurVerwachting3.json', location, data)
# Sun forecast #####################################################################################
# Print some help:
meteo.print_help_zonactueel()
# Read a Meteoserver Sun-data JSON file from disc:
# current, forecast = meteo.read_json_file_zon('ZonActueel.json')
# current, forecast, location = meteo.read_json_file_zon('ZonActueel.json', loc=True) # Return the location
# Get Meteoserver Sun data from the server for the given location (and key):
# current, forecast = meteo.read_json_url_zon(myKey, myLocation)
current, forecast, location = meteo.read_json_url_zon(myKey, myLocation, loc=True) # Return the location
# Print the current-weather and forecast dataframes:
print("\nCurrent Sun/weather observation from a nearby station:")
print(current)
print("\nSun/weather forecast for the selected location/region:")
print(forecast)
# Write the downloaded data to a json file:
meteo.write_json_file_zon('ZonActueel1.json', location, current, forecast)
Meteoserver pages
Author and licence
- Author: Marc van der Sluys
- Contact: http://han.vandersluys.nl/en/
- Licence: GPLv3+
References
- Data, API key and API documentation can be obtained from Meteoserver.nl
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 meteoserver-0.0.6.tar.gz
.
File metadata
- Download URL: meteoserver-0.0.6.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 100e02aa98ea5481cb2f567f670697d84d550f046b45ece6be1b0a2b717f7f9a |
|
MD5 | 567e96b711d3a70c43b63668f9ea8277 |
|
BLAKE2b-256 | 5209a4d322fb53d5d431bd48baf257bdb104dfde7b2187c13c6cf9390babf9f2 |
File details
Details for the file meteoserver-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: meteoserver-0.0.6-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a6f3199bc7bb23fa4ea83be80ca43b2a9469d2e14165680277d635f84ec77b4 |
|
MD5 | 6f2feefa9a092c1a64f8378b4286622f |
|
BLAKE2b-256 | 281f5a20b92845fd2b327b4d7d107c9da5636a3d28f2d3cffc9d4e178f7ffe9b |