Skip to main content

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

Project description

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

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

python_weather-2.1.2.tar.gz (12.6 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.1.2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for python_weather-2.1.2.tar.gz
Algorithm Hash digest
SHA256 2b40f6fff32cbde16066a6cd763fe04624e9081600338c1e69f35f908560e0da
MD5 56be8b38d9ff4d6341cf1a89ce66fd2b
BLAKE2b-256 d394a588077a78af7968d13a3759756590a722488fa1d6d3e6e911873d651bf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_weather-2.1.2.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.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for python_weather-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eaa86ac987ea589b36f9e40d65a31c247e48f7488a20c6647d237a596269718d
MD5 0508e6dc32c607173d3f046b18d26893
BLAKE2b-256 c28093f400a42b0c3d7a356428f702e6d094a3d523ac0673ce777f1334d1b1c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_weather-2.1.2-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 Pingdom Monitoring Sentry Error logging StatusPage Status page