Skip to main content

WorldWeatherPy

A Python library for the retrieval of historical weather data.

This library scrapes WorldWeatherOnline.com to collect historical weather data, returning a Pandas DataFrame. The DetermineListOfAttributes class returns all weather attributes available for retrieval through the WorldWeatherOnline.com API, whilst the HistoricalLocationWeather class retrieves an array of typically required weather attributes. The RetrieveByAttribute class can be used to request specific weather attributes, or a list of specific weather attributes, as available through the DetermineListOfAttributes class.

Installation

From Python:

pip install WorldWeatherPy
from WorldWeatherPy import DetermineListOfAttributes
from WorldWeatherPy import HistoricalLocationWeather
from WorldWeatherPy import RetrieveByAttribute

Usage

If you are unsure of the available weather attributes:

pip install WorldWeatherPy
from WorldWeatherPy import DetermineListOfAttributes
attributes = DetermineListOfAttributes(api_key, True).retrieve_list_of_options()

Returns a list containing all available weather attributes. If 'verbose' is set to True, this will be printed within the function call.

If you would like to retrieve standard weather attributes:

pip install WorldWeatherPy
from WorldWeatherPy import HistoricalLocationWeather
dataset = HistoricalLocationWeather(api_key, city, start_date, end_date, frequency).retrieve_hist_data()

Returns a Pandas DataFrame 'dataset', which contains an array of weather attributes for the given city, between the start and end dates specified, with hourly frequency, indexed by date and time.

If you would like to retrieve specific weather attributes:

pip install WorldWeatherPy
from WorldWeatherPy import RetrieveByAttribute
dataset = RetrieveByAttribute(api_key, attribute_list, city, start_date, end_date, frequency).retrieve_hist_data()

Returns a Pandas DataFrame 'dataset', which contains a list of pre-specified weather attributes for the given city, between the start and end dates specified, with hourly frequency, indexed by date and time.

Input Arguments

Argument Description
api_key the API key obtained from https://www.worldweatheronline.com/developer/. (str)
attribute_list a list of weather attributes to collect. (list)
city a city for which to retrieve data. (str).
start_date a string in the format YYYY-MM-DD (str).
end_date a string in the format YYYY-MM-DD (str).
frequency the frequency of extracted data, measured in hours. (int)
verbose boolean determining printing during data extraction. (bool) [Default = True]
csv_directory an optional file directory to store the output. (os directory) [Default = None]

Metadata

Release files for WorldWeatherPy 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WorldWeatherPy 0.0.3
File Size Uploaded Provenance Actions
WorldWeatherPy-0.0.3.tar.gz 6.3 kB Without provenance Details for WorldWeatherPy-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for WorldWeatherPy 0.0.3
File Interpreter ABI Platform Actions
WorldWeatherPy-0.0.3-py3-none-any.whl Python 3 none any Details for WorldWeatherPy-0.0.3-py3-none-any.whl

Total release size: 15.9 kB

Release files / WorldWeatherPy-0.0.3.tar.gz

Download URL WorldWeatherPy-0.0.3.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
356bc867e3d6071820dd9bfc8dc3cc41d59eb0f92183fe6ed2834e657faa063f
BLAKE2b-256 checksum
How to use checksums
124ef55a6341c98eb30f2255fef1197ee9beff61205cd9c617df96788a7633bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / WorldWeatherPy-0.0.3-py3-none-any.whl

Download URL WorldWeatherPy-0.0.3-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e006dd72128a52dbbfb5a113fef97efb012d76853fdce27abefe7115c94574e
BLAKE2b-256 checksum
How to use checksums
99f0cc3f98e918f2c3d1259e38d8648d524f3a88ddff28f0d192c19a66dfab7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Security for WorldWeatherPy 0.0.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page