Registry / data / meteostat

meteostat

JSON →
library2.1.4pypypi✓ verified 22d ago

Meteostat is an open-source Python library that provides an easy and efficient way to access and analyze historical weather and climate data. It retrieves observations and statistics from Meteostat's bulk data interface, which aggregates information from various public sources, including national weather services like NOAA and DWD. The library is currently at version 2.1.4 and is actively maintained with a focus on performance improvements and a consistent API experience.

pip install meteostat
INSTALL
IMPORT
SIG · METEOSTAT
M
meteostat
datapythonv2.1.4
Install
8.1s avg
Import
1198ms
Disk
169MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.230s · 164.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.1s · import 1.166s · 157MB
169MB installed
● package 169MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Point
from meteostat import Point
Used to define geographical coordinates for data retrieval.
Daily
from meteostat import Daily
Used to fetch daily weather data.
Hourly
from meteostat import Hourly
Used to fetch hourly weather data.
Stations
from meteostat import Stations
Used to filter and access information about weather stations.
Parameter
from meteostat import Parameter
Provides access to meteorological parameters for plotting or data selection.

This quickstart code demonstrates how to fetch and plot daily temperature data for a specific geographical point (Frankfurt, Germany) using the `meteostat` library. It involves defining a `Point`, specifying a date range, finding nearby stations, fetching and interpolating daily data, and then plotting the average, minimum, and maximum temperatures.

from datetime import date import matplotlib.pyplot as plt import meteostat as ms # Specify location and time range for Frankfurt, Germany POINT = ms.Point(50.1155, 8.6842, 113) START = date(2018, 1, 1) END = date(2018, 12, 31) # Get nearby weather stations stations = ms.stations.nearby(POINT, limit=4) # Get daily data & perform interpolation ts = ms.daily(stations, START, END) df = ms.interpolate(ts, POINT).fetch() # Plot line chart including average, minimum and maximum temperature df.plot(y=[ms.Parameter.TEMP, ms.Parameter.TMIN, ms.Parameter.TMAX]) plt.title('2018 Temperature Data for Frankfurt, Germany') plt.xlabel('Date') plt.ylabel('Temperature (°C)') plt.show()
Debug
Known issues
breakingMeteostat 2.0.0 introduced breaking changes, including performance improvements and a more consistent API experience. Code written for versions prior to 2.0.0 may require adjustments.
fix
Refer to the official Meteostat Python library documentation for migration guides and updated API usage for versions 2.0.0 and above.
affects: <2.0.0
deprecatedMeteostat shut down version 1 of its JSON API on May 1, 2021. While this primarily affects direct API users, older versions of the Python library might have relied on aspects of API v1, leading to unexpected behavior if not updated.
fix
Ensure you are using the latest stable version of the `meteostat` Python library (2.0.0 or newer) which is designed to interact with API v2 and the bulk data interface.
affects: Potentially library versions released around or before March 2021 that interacted with API v1.
gotchaBy default, Meteostat caches data dumps on your local drive in `~/.meteostat/cache`. If you are short on storage, monitor the cache size or specify a different `cache_dir` parameter.
fix
To change the cache directory, set the `cache_dir` parameter when initializing any of the library's classes (e.g., `ms.Point(..., cache_dir='/path/to/new/cache')`).
affects: All versions
gotchaMeteostat uses the metric system (e.g., °C for temperature, mm for precipitation, km/h for wind speed) and UTC for time. Ensure your data processing and visualizations account for these default units and timezones.
fix
Convert units or adjust for timezones explicitly in your code if different systems are required. The documentation provides details on the units used.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'meteostat'
The 'meteostat' package is not installed in the Python environment being used.
fix
Install the package using pip: `pip install meteostat`
AttributeError: 'Series' object has no attribute 'fetch'
This error typically occurs when attempting to call `.fetch()` on a pandas Series containing `meteostat.Daily` or `meteostat.Hourly` objects, instead of calling `.fetch()` on each individual `TimeSeries` object or combining them appropriately.
fix
Iterate through the Series and call `.fetch()` on each element, then concatenate the results, or use a method like `meteostat.merge` to combine `TimeSeries` objects before fetching. For example, instead of `data = df.apply(lambda x: Daily(x['point'], start, end), axis=1); data = data.fetch()`, you might need to do `data_list = [ms.Daily(row['point'], start, end).fetch() for _, row in df.iterrows()]; df_combined = pd.concat(data_list)`.
AttributeError: 'NoneType' object has no attribute 'name'
This error often indicates that a `meteostat` method, such as `stations.nearby()` or `stations.meta()`, returned `None` (because no matching station or data was found for the given parameters), and subsequently, an attempt was made to access an attribute (like 'name', 'id', 'lat', etc.) of this `None` object.
fix
Always check if the returned object is `None` before attempting to access its attributes. For example: `station = ms.stations.meta('nonexistent_id'); if station: print(station.name)`
AttributeError: 'Stations' object has no attribute 'nearby'
This error can occur if you're trying to call `nearby` on an incorrectly imported or instantiated `Stations` object, or if there was a version mismatch where the `nearby` method was expected to be accessed differently.
fix
Ensure you are using the officially documented way to access station methods, which is typically `import meteostat as ms; stations = ms.stations.nearby(point)`. The `ms.stations` object is the correct entry point for station-related queries in current versions.
Upgrade
Version history
2.1.4latest on PyPI · released Mar 21, 2026
Audit
Dependencies
pandasrequiredMeteostat is built on top of Pandas for data analysis and returns data in Pandas DataFrames.
pyarrowrequiredRequired for efficient data handling, automatically installed as a dependency.
Agent activity
11 hits · last 30 days
node
10
Resources
meteostat — pip install meteostat · libregistry