Skip to main content

python-weather pypi pypi downloads codacy-badge codecov-badge ko-fi

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

Getting started

Run the following command in your terminal:

pip install python-weather

Example

For more information, please read the documentation.

# 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, which uses data from the World Weather Online API.

Donations

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

ko-fi

Download files

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

Source Distribution

python_weather-2.2.3.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_weather-2.2.3-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file python_weather-2.2.3.tar.gz.

File metadata

  • Download URL: python_weather-2.2.3.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for python_weather-2.2.3.tar.gz
Algorithm Hash digest
SHA256 541a580f3166dbbfdf2e89439d8e737842a17ffe16c0878235b1e869a057e5bc
MD5 a0d900e85305f553064b47d6b56f77f3
BLAKE2b-256 62afa120e0d33d95c0529c6e52d07413a431f97b09c1d1e700ca7d7edd272519

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_weather-2.2.3.tar.gz:

Publisher: publish.yml on null8626/python-weather

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_weather-2.2.3-py3-none-any.whl.

File metadata

  • Download URL: python_weather-2.2.3-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for python_weather-2.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 52e665f135d7992e8087e6daf1f750026b778826e3c91627c44308af63a830d7
MD5 1cb097a7a0b6f332cec3bc80609f2ecf
BLAKE2b-256 d86004b030c7103670c555a593803d064d73585a6b637520eca7a6e736fa38f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_weather-2.2.3-py3-none-any.whl:

Publisher: publish.yml on null8626/python-weather

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page