Skip to main content

python-weather

A free and asynchronous weather API wrapper made in python.

Library Example

# import the module
import python_weather
import asyncio

async def getweather():
    # declare the client. format defaults to metric system (celcius, km/h, etc.)
    client = python_weather.Client(format=python_weather.IMPERIAL)

    # fetch a weather forecast from a city
    weather = await client.find("Washington DC")

    # returns the current day's forecast temperature (int)
    print(weather.current.temperature)

    # get the weather forecast for a few days
    for forecast in weather.forecasts:
        print(str(forecast.date), forecast.sky_text, forecast.temperature)

    # close the wrapper once done
    await client.close()

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(getweather())

Use example.py for a quick run ;)

Weather CLI

This package also contains a simple weather CLI for it. To get all usage and supported flags, run:

$ weather -h

Examples:

$ weather washington dc -u f -c
$ weather washington dc -o file.json

Metadata

Release files for python-weather 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-weather 0.3.4
File Size Uploaded Provenance Actions
python-weather-0.3.4.tar.gz 9.1 kB Without provenance Details for python-weather-0.3.4.tar.gz

Release files / python-weather-0.3.4.tar.gz

Download URL python-weather-0.3.4.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
85c8662a0ea5418588ea7a843224d22f7b808d4019ded8de83a8452336757710
BLAKE2b-256 checksum
How to use checksums
0dbd2eb9ab5e1588b0b43d75f2a06d0c57606aef97130b21cd1ab165d3cecec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.5

Security for python-weather 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.4 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page