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
For now, there is only basic functionality included in this package. However, I hope to add more features in the future.
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 userfriendly 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
weather = WeatherClient(token=API_KEY, city="sydney", country="canada")
# Provides information about the location
weather.location
# The country argument for the WeatherClient instance is optional
# The code below would give you the location for Syndey, Australia
weather = WeatherClient(token=API_KEY, city="sydney")
# Creates an instance 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.to_pandas_df()
# Creates an instance 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
Built Distribution
Close
Hashes for accuweather_client-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 917e5ac56179a5bc4902afd5370029a9242c7f8a635002c25333706b2ec065a9 |
|
MD5 | 916cc86c603e5e49c3a8ae7ef2fab17c |
|
BLAKE2b-256 | 99b5b21aded620579806629513a016dc27e2736636fcfc1c14c4edab0e5f9724 |