{"id":5320,"library":"meteostat","title":"Meteostat Python Library","description":"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.","status":"active","version":"2.1.4","language":"en","source_language":"en","source_url":"https://github.com/meteostat/meteostat","tags":["weather","climate","data science","pandas","api"],"install":[{"cmd":"pip install meteostat","lang":"bash","label":"Latest Stable Version"}],"dependencies":[{"reason":"Meteostat is built on top of Pandas for data analysis and returns data in Pandas DataFrames.","package":"pandas","optional":false},{"reason":"Required for efficient data handling, automatically installed as a dependency.","package":"pyarrow","optional":false}],"imports":[{"note":"Used to define geographical coordinates for data retrieval.","symbol":"Point","correct":"from meteostat import Point"},{"note":"Used to fetch daily weather data.","symbol":"Daily","correct":"from meteostat import Daily"},{"note":"Used to fetch hourly weather data.","symbol":"Hourly","correct":"from meteostat import Hourly"},{"note":"Used to filter and access information about weather stations.","symbol":"Stations","correct":"from meteostat import Stations"},{"note":"Provides access to meteorological parameters for plotting or data selection.","symbol":"Parameter","correct":"from meteostat import Parameter"}],"quickstart":{"code":"from datetime import date\nimport matplotlib.pyplot as plt\nimport meteostat as ms\n\n# Specify location and time range for Frankfurt, Germany\nPOINT = ms.Point(50.1155, 8.6842, 113)\nSTART = date(2018, 1, 1)\nEND = date(2018, 12, 31)\n\n# Get nearby weather stations\nstations = ms.stations.nearby(POINT, limit=4)\n\n# Get daily data & perform interpolation\nts = ms.daily(stations, START, END)\ndf = ms.interpolate(ts, POINT).fetch()\n\n# Plot line chart including average, minimum and maximum temperature\ndf.plot(y=[ms.Parameter.TEMP, ms.Parameter.TMIN, ms.Parameter.TMAX])\nplt.title('2018 Temperature Data for Frankfurt, Germany')\nplt.xlabel('Date')\nplt.ylabel('Temperature (°C)')\nplt.show()","lang":"python","description":"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."},"warnings":[{"fix":"Refer to the official Meteostat Python library documentation for migration guides and updated API usage for versions 2.0.0 and above.","message":"Meteostat 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.","severity":"breaking","affected_versions":"<2.0.0"},{"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.","message":"Meteostat 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.","severity":"deprecated","affected_versions":"Potentially library versions released around or before March 2021 that interacted with API v1."},{"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')`).","message":"By 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Convert units or adjust for timezones explicitly in your code if different systems are required. The documentation provides details on the units used.","message":"Meteostat 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}