WorldWeatherOnline historical weather data API wrapper
This package is used to retrieve and transform historical weather data from www.worldweatheronline.com into pandas dataframe and csv.
You can get API key for free (free trial 500 requests/key/day for 60 days, as of 30-May-2019).
example API explorer: https://www.worldweatheronline.com/developer/premium-api-explorer.aspx
Input: api_key, location_list, start_date, end_date, frequency
Output: location_name.csv
Output column names: date_time, maxtempC, mintempC, totalSnow_cm, sunHour, uvIndex, uvIndex, moon_illumination, moonrise, moonset, sunrise, sunset, DewPointC, FeelsLikeC, HeatIndexC, WindChillC, WindGustKmph, cloudcover, humidity, precipMM, pressure, tempC, visibility, winddirDegree, windspeedKmph
Install the package:
pip install wwo-hist
Import package
from wwo_hist import retrieve_hist_data
Set working directory to store output csv file(s)
import os
os.chdir(".\YOUR_PATH")
Example code
frequency=3
start_date = '11-DEC-2018'
end_date = '11-MAR-2019'
api_key = 'YOUR_API_KEY'
location_list = ['singapore','california']
hist_weather_data = retrieve_hist_data(api_key,
location_list,
start_date,
end_date,
frequency,
location_label = False,
export_csv = True,
store_df = True)
Parameters:
api_key: string
(Premium/ free trial) API key from https://www.worldweatheronline.com/developer/api/
location_list: list of string
US Zipcode, UK Postcode, Canada Postalcode, IP address, Latitude/Longitude (decimal degree) or city name
start_date: string
Preferred date format: 'dd-mmm-yyyy'
end_date: string
Preferred date format: 'dd-mmm-yyyy'
frequency: integer
1, 3, 6, 12, 24
1 hourly, 3 hourly, 6 hourly, 12 hourly (day/night) or 24 hourly (day average)
location_label: bool, default = False
If True, all column names will have city name as prefix.
export_csv: bool, default = True
If False, no csv file will be exported to current directory.
store_df: bool, default = False
If True, retrieved dataframe(s) will be stored as list in the work space.
Console view
Output file
Metadata
Release files for wwo-hist 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| wwo_hist-0.0.7.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wwo_hist-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / wwo_hist-0.0.7.tar.gz
| Download URL | wwo_hist-0.0.7.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5bbe68a9da694a37b1ac71b2353417d22643490849b5d898db9d5bc82aa9693
|
|
BLAKE2b-256 checksum How to use checksums |
5dbfecad8e88302c526b157a4c19754c7dc0e4879cf1e9dd5288c12ee020e5fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.4.2 requests/2.21.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0
|
Release files / wwo_hist-0.0.7-py3-none-any.whl
| Download URL | wwo_hist-0.0.7-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a52ed7beae869f2993fd9ef85f27aac3e4670883d1790d663a29c55f7e7e182d
|
|
BLAKE2b-256 checksum How to use checksums |
96d2823c1175988a910819a76bab7e01e6ae13b7af4fa2d40bd4fdf9165573e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.4.2 requests/2.21.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0
|
Security for wwo-hist 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.