Skip to main content

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


Download files

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

Source Distribution

weather-update-1.0.1.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

weather_update-1.0.1-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

Supported by

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