The Meteostat Julia library provides a simple API for accessing open weather and climate data. The historical observations and statistics are collected by Meteostat from different public interfaces, most of which are governmental.
Among the data sources are national weather services like the National Oceanic and Atmospheric Administration (NOAA) and Germany's national meteorological service (DWD).
This project is not affiliated to the Meteostat organisation. Do consider donating to support the open source project.
import Pkg
Pkg.add("Meteostat")
Let's plot 2018 temperature data for Vancouver, BC:
# Import Meteostat library and dependencies
using Meteostat:Point, fetch_data
using Dates
using AlgebraOfGraphics, CairoMakie
# Set time period
start_date = Date(2018, 1, 1)
end_date = Date(2018, 12, 31)
# Create Point for Vancouver, BC
location = Point(49.2497, -123.1193, 70.)
# Get daily data for 2018
weather_data = fetch_data(location, Dates.Day, start_date, end_date)
# Plot line chart including average, minimum and maximum temperature
fig = (
data(weather_data)
* mapping(:time, [:tavg, :tmin, :tmax], color=dims(1) => renamer(["avg", "min", "max"]) => "Temperatures ")
* visual(Lines)
)
draw(fig;
figure=(;title="Vancouver, BC"),
axis=(;width=600)
)
Instructions on building and testing the Meteostat Python package can be found in the documentation. More information about the Meteostat bulk data interface is available here.
If you want to support the project financially, you can make a donation using one of the following services:
Meteorological data is provided under the terms of the Creative Commons Attribution-NonCommercial 4.0 International Public License (CC BY-NC 4.0). You may build upon the material for any purpose, even commercially. However, you are not allowed to redistribute Meteostat data "as-is" for commercial purposes.
By using the Meteostat Julia library you agree to Meteostat's terms of service. All meteorological data sources used by the Meteostat project are listed here.
The code of this library is available under the MIT license.