You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Meteostat Python 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 weather service (DWD).
Are you looking for a hosted solution? Try our JSON API.
Installation
The Meteostat Python package is available through PyPI:
pip install meteostat
Meteostat requires Python 3.6 or higher. If you want to visualize data, please install Matplotlib, too.
Documentation
The Meteostat Python library is divided into multiple classes which provide access to the actual data. The documentation covers all aspects of the library:
Let's plot 2018 temperature data for Vancouver, BC:
# Import Meteostat library and dependenciesfromdatetimeimportdatetimeimportmatplotlib.pyplotaspltfrommeteostatimportPoint, Daily# Set time periodstart=datetime(2018, 1, 1)
end=datetime(2018, 12, 31)
# Create Point for Vancouver, BClocation=Point(49.2497, -123.1193, 70)
# Get daily data for 2018data=Daily(location, start, end)
data=data.fetch()
# Plot line chart including average, minimum and maximum temperaturedata.plot(y=['tavg', 'tmin', 'tmax'])
plt.show()
Take a look at the expected output:
Contributing
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.
Donating
If you want to support the project financially, you can make a donation using one of the following services:
By using the Meteostat Python library you agree to our terms of service. All meteorological data sources used by the Meteostat project are listed here.
Code License
The code of this library is available under the MIT license.
About
Access and analyze historical weather and climate data with Python.