This python library easily obtains weather data across various locations and dates.
Project description
forecast-weather
This python library easily obtains weather data across various locations and dates.
Overview
forecast-weather is a library that allows a user to easily obtain weather data (temperatures, pressure, humidity, precipitation, wind, cloud coverage, etc.) across various locations and dates. The library will make calls to a public weather API and will organize the returned data for ease of use. Some extra functionality in consideration include some form of visual plot/graph generation.
Install
pip install forecast-weather
API Key
Go to weatherapi.com to register an account for your free api key. Create a new file ./api_key and paste your api key here.
Usage
import forecast_weather as fw
fw.show_current(location = "10027")
fw.show_forecast(location = "10027", days = "2")
current = fw.get_current(location = "10027")
forecast = fw.get_forecast(location = "10027", days = "3")
Example
Running the following code
import forecast_weather as fw
fw.show_current(location = "10027")
Outputs something like this to the console
Current weather at New York is:
Temperature: 68.0 F/ 20.0 C
Condition: Overcast
Wind speed: 2.2 mph
Pressure: 1017.0 mb
Precipitation: 0.0 in
Humidity: 55%
Cloud coverage: 100%
UV: 4.0
Demo
Details
This project is a pure python project using modern tooling. It uses a Makefile as a command registry, with the following commands:
make: list available commandsmake develop: install and build this library and its dependencies usingpipmake build: build the library usingsetuptoolsmake lint: perform static analysis of this library withflake8andblackmake format: autoformat this library usingblackmake annotate: run type checking usingmypymake test: run automated tests withpytestmake coverage: run automated tests withpytestand collect coverage informationmake dist: package library for distribution
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file forecast-weather-0.1.2.tar.gz.
File metadata
- Download URL: forecast-weather-0.1.2.tar.gz
- Upload date:
- Size: 160.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36693b2a78c0cfd92eb05b7bb1ce6bf82ace2bd044f7235df798aa826ab661f4
|
|
| MD5 |
c4f2b22f442ea5d9635587f12d3d4cf9
|
|
| BLAKE2b-256 |
49ec6c8c94712ce5bfc61937f9e0b9df0c2147c7f04f5d20243d57fa7081cf2b
|