Skip to main content

Access and analyze historical weather and climate data with Python.

Project description

Meteostat Python Package

The Meteostat Python library provides a simple API for accessing open weather and climate data. The historical observations and statistics are collected by the Meteostat project 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).

Installation

The Meteostat Python package is available through PyPI:

pip install meteostat

Meteostat requires Python 3.5 or higher.

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:

Example

Let's pretend you want to plot temperature data for Vancouver, BC from 2018:

# Import Meteostat library and dependencies
from datetime import datetime
import matplotlib.pyplot as plt
from meteostat import Stations, Daily

# Set coordinates of Vancouver
lat = 49.2497
lon = -123.1193

# Set time period
start = datetime(2018, 1, 1)
end = datetime(2018, 12, 31)

# Get closest weather station to Vancouver, BC
stations = Stations()
stations = stations.nearby(lat, lon)
stations = stations.inventory('daily', (start, end))
station = stations.fetch(1)

# Get daily data for 2018 at the selected weather station
data = Daily(station, start, end)
data = data.fetch()

# Plot line chart including average, minimum and maximum temperature
data.plot(y=['tavg', 'tmin', 'tmax'])
plt.show()

Take a look at the expected output:

2018 temperature data for Vancouver, BC

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.

If you want to support the project financially, you can make a donation via:

Data License

Meteorological data is provided under the terms of the Creative Commons Attribution-NonCommercial 4.0 International Public License. Please be aware that Meteostat uses data which is shared under WMO resolution 40.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meteostat-1.0.2.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

meteostat-1.0.2-py2-none-any.whl (13.8 kB view details)

Uploaded Python 2

File details

Details for the file meteostat-1.0.2.tar.gz.

File metadata

  • Download URL: meteostat-1.0.2.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.3

File hashes

Hashes for meteostat-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2a8d406a1859a7f0ad0a6c34ee985b6b0b9da05750d4ed0bb690391aae31b998
MD5 e15e242d80af1aaba6c341daa8299ea9
BLAKE2b-256 8c9f73ee30cb9fb376ce6c594ff1f43994790db7f7d66b301ada5ca3353696bb

See more details on using hashes here.

File details

Details for the file meteostat-1.0.2-py2-none-any.whl.

File metadata

  • Download URL: meteostat-1.0.2-py2-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.3

File hashes

Hashes for meteostat-1.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 0484b5e403e5b4ae93f14a5dd53bbb443eb8a62666a585bff23cf1bdd86e356c
MD5 c072cc4261d78e72458b556a64682c59
BLAKE2b-256 dc0b801adbe6c8da04461e189f8c60235a3a4b0a4e7e3ea2e80829deacb1d335

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page