Skip to main content

The goal of this project is to create a user-friendly api client for AccuWeather api.

Project description

AccuWeather

A python library to interact with the accuweather api.

General information

The functionality that makes this package unique is the integration of the location client within the weather client. Specifying location by city name (and country optionally) is a more user-friendly way to interact with the api.

Before you start

You need to create an api token on the AccuWeather website (https://developer.accuweather.com).

How to use the package

""""Some code to show the functionality of the package"""

from accuweather_client.clients import WeatherClient
from constants import API_KEY

# Create an instance of the WeatherClient class, a regular search
weather = WeatherClient(token=API_KEY, city="sydney")
# Provides information about the location
weather.location

# In the example above, the selected location is Sydney, Australia
# If you like to select Sydney in Canada, you can refine your search with
# the addition of the country parameter
weather = WeatherClient(token=API_KEY, city="sydney", country="canada")
weather.location

# Create an instance of the WeatherClient class, POI search
weather = WeatherClient(token=API_KEY, poi="Eiffel tower")
weather.location

# Create an instance of the WeatherClient class, lat lon search
weather = WeatherClient(token=API_KEY, lat=51.988, lon=-4.88)
weather.location

# Creates an object that yields forecast information
forecast = weather.get_5day_forecast()
# Prints the forecast for tomorrow
forecast.forecast_tomorrow
# Returns a pandas df with forecast information
forecast_df = forecast.to_pandas_df()

# Creates an object that yields hourly forcast information
forecast_hourly = weather.get_hourly_forecast_12h()

# Creates an object that yiels information about the current conditions
conditions = weather.get_current_conditions()
# Prints the current conditions
conditions.current_conditions

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

accuweather_client-1.0.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

accuweather_client-1.0.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file accuweather_client-1.0.0.tar.gz.

File metadata

  • Download URL: accuweather_client-1.0.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for accuweather_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5680c8e74241d2e2f9c74a92636ccefef717314459fe550c1c6cba4a1c9bbe4e
MD5 3316e79ea1a4b9923880db8ba9ed5385
BLAKE2b-256 e4fcb8d143f5ebdf4fa4d4542a0a0f3b79524e269fe3088bc2b3f024ff16cdc3

See more details on using hashes here.

File details

Details for the file accuweather_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for accuweather_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3b49c6c1c5b8d44158239b3337e46ad255a51bbce86f8793ab26555ff5ba76e
MD5 b0e4771d463163ab92e062130bbdeefa
BLAKE2b-256 0fb2e1ef79d67bdfd23b8d5955883ece7bfbf7772b7c13c7b4c3d4bad715583e

See more details on using hashes here.

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