No project description provided
Project description
Weather Update Library
A simple Python library to fetch the weather updates for a specified location.
Installation
You can install the library using pip:
pip install weather-update
Usage
Before you can use the library, you need to set your OpenWeatherMap API key. The library will prompt you to enter the API key the first time you run it. The API key will be stored in a configuration file for subsequent use.
To get the weather updates for a location, use the get_weather function:
from weather_update.weather import get_weather
weather = get_weather("London,UK")
print(f"Weather in London: {weather['weather'][0]['description']}, {weather['main']['temp']}°C")
API Reference
-
get_weather(location: str) -> dict
Get the weather updates for the specified location.Arguments
location
: str -- location for which the weather updates are needed
Returns
A dictionary containing the weather updates for the specified location.
-
set_api_key()
Set the OpenWeatherMap API key in the configuration file. The library will prompt you to enter the API key if it has not been set already.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file weather-update-1.0.1.tar.gz
.
File metadata
- Download URL: weather-update-1.0.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.9.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd63a5c42502e2c15a5781effede837d04659db65d0be08614a5c7740c1ca122 |
|
MD5 | 66b1f3f910a672af4d8f4fa21471961e |
|
BLAKE2b-256 | c38158c35cdb96ad6bc6885fc2865850edb28543307dd79385cf6706392287fe |
File details
Details for the file weather_update-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: weather_update-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.9.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7c7f8e53ec9d4c2e6fcf93c7057f890fc793c586238085ec0c552fb9cc6a9c3 |
|
MD5 | 03a8f430cfdb3f133dadfa3f1c9ce647 |
|
BLAKE2b-256 | 18322c64a239e1c4ce6b2ffea5ef52457446942d27629a048e2969b9c6a7a4b6 |