Skip to main content

openweathermap requests fetch weather history Pandas DataFrame

Project description

Latest Version Supported Python versions Wheel format License Development Status Downloads monthly Documentation Status Sourcegraph Gitter Code Health Build Status

OpenWeatherMap Requests

Python package to fetch data from using Requests and Requests-cache and get Pandas DataFrame with weather history.

Command Line Interface Usage

Current weather

Get current weather data

$ python --lon 0.34189 --lat 46.5798114

Historical weather data

Fetch historical weather data from nearest weather station of coordinates (lon=0.34189, lat=46.5798114) from 2014/01/01 to 2014/12/01 using:

$ python --lon 0.34189 --lat 46.5798114 --range 20140101:20141201

Library Usage

import datetime
import logging
logger = logging.getLogger()
from openweathermap_requests import OpenWeatherMapRequests

ow = OpenWeatherMapRequests(api_key='', cache_name='cache-openweathermap', expire_after=5*60)

(lon, lat) = (0.34189, 46.5798114) # Poitiers

data = ow.get_weather(lon=lon, lat=lat)  # display current weather data

stations = ow.find_stations_near(lon=lon, lat=lat, cnt=10) # get 10 nearest stations from coordinates (lon, lat)

station_id = stations.iloc[0][''] # get station_id of nearest station

start_date = datetime.datetime(2014, 1, 1)
end_date = datetime.datetime(2014, 6, 1)

data = ow.get_historic_weather(station_id, start_date, end_date) # get historic weather from start date to end date


From Python package index

$ pip install openweathermap_requests

From source

Get latest version using Git

$ git clone
$ cd openweathermap_requests
$ python install

Project details

Download files

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

Files for openweathermap_requests, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size openweathermap_requests-0.0.5-py2.py3-none-any.whl (8.5 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size openweathermap_requests-0.0.5.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page