Metadata-Version: 2.4
Name: python-weather
Version: 2.1.2
Summary: A free and asynchronous weather API wrapper made in Python, for Python.
Author: null8626
License: MIT
Project-URL: Documentation, https://python-weather.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/null8626/python-weather
Project-URL: Changelog, https://python-weather.readthedocs.io/en/latest/changelog.html
Project-URL: Donate via GitHub Sponsors, https://github.com/sponsors/null8626
Project-URL: Donate via Ko-fi, https://ko-fi.com/null8626
Keywords: weather,forecast,weather-forecast
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Education
Classifier: Topic :: Internet
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.13.3
Dynamic: license-file

# [python-weather][pypi-url] [![pypi][pypi-image]][pypi-url] [![pypi downloads][pypi-downloads-image]][pypi-url] [![codacy-badge][codacy-image]][codacy-url] [![codecov-badge][codecov-image]][codecov-url] [![ko-fi][ko-fi-brief-image]][ko-fi-url]

[pypi-url]: https://pypi.org/project/python-weather/
[pypi-image]: https://img.shields.io/pypi/v/python-weather.svg?style=flat-square
[pypi-downloads-image]: https://img.shields.io/pypi/dm/python-weather?style=flat-square
[codacy-url]: https://app.codacy.com/gh/null8626/python-weather/dashboard
[codacy-image]: https://app.codacy.com/project/badge/Grade/0f7721b7e4314a748c75a04f0a7e0ce3
[codecov-url]: https://codecov.io/gh/null8626/python-weather
[codecov-image]: https://codecov.io/gh/null8626/python-weather/graph/badge.svg
[ko-fi-url]: https://ko-fi.com/null8626
[ko-fi-image]: https://ko-fi.com/img/githubbutton_sm.svg
[ko-fi-brief-image]: https://img.shields.io/badge/donations-ko--fi-red?color=ff5e5b&style=flat-square

A free and asynchronous weather Python API wrapper made in Python, for Python.

## Getting started

Run the following command in your terminal:

```console
pip install python-weather
```

## Example

For more information, please read the [documentation](https://python-weather.readthedocs.io/en/latest/).

```py
# Import the module.
import python_weather

import asyncio


async def main() -> None:
  
  # Declare the client. The measuring unit used defaults to the metric system (celcius, km/h, etc.)
  async with python_weather.Client(unit=python_weather.IMPERIAL) as client:
    
    # Fetch a weather forecast from a city.
    weather = await client.get('New York')
    
    # Fetch the temperature for today.
    print(weather.temperature)
    
    # Fetch weather forecast for upcoming days.
    for daily in weather:
      print(daily)
    
      # Each daily forecast has their own hourly forecasts.
      for hourly in daily:
        print(f' --> {hourly!r}')

if __name__ == '__main__':
  asyncio.run(main())
```

## Data source

This library depends on [`wttr.in`](https://github.com/chubin/wttr.in), which uses data from the [World Weather Online API](https://www.worldweatheronline.com/weather-api/).

## Donations

If you want to support this project, consider donating! ❤

[![ko-fi][ko-fi-image]][ko-fi-url]
