A simple weather library for Python.
Project description
Pyweath
Pyweath is a Python package designed for developers looking to integrate weather forecasting features into their applications. Using the OpenWeatherMap API, Pyweath provides access to current weather conditions, air quality data, and a five day weather forecast for any location specified by city name or latitude/longitude position.
PyPi Link: https://pypi.org/project/pyweath
Documentation
get_todays_forecast_ll(lat, lon)
Example:
print(get_todays_forecast_ll(40.7128, -74.0060))
For more: example python program
get_todays_forecast_city(city)
Retrieves today's weather forecast based on city, returns a string.
Example:
print(get_todays_forecast_ctiy("Tokyo"))
For more: example python program
fiveday_forecast_city(city)
Retrieves five day weather forecast graph or list of temperatures for a specificied city, based off user input, outputs graph or list of strings.
Example:
fiveday_forecast_city("Dubai")
Would you like to see the graph? (y/n): n
For more: example python program
get_today_airqual_city(city):
Retrieve today's air quality for a specificied city using Geocoder API to locate coordinates, returns a string. Extra details about componenets in air are available upon user input.
Example:
print(get_todays_airqual_city("New York"))
Would you like to see extra air quality details? (y/n): y
For more: example python program
Installation & Use
If using the package in your own python program:
- Make a pipenv (managed virtual environment) and install latest version of pyweath via:
pipenv install pyweath
Note: If you've previously created a pipenv virtual environment in the same directory, you may have to delete the old one first. Find out where it is located with the pipenv --venv command. For more information see: https://pipenv.pypa.io/en/latest/. - Enter the virtual environment:
pipenv shell
- Create a Python file (ex:
my_program.py
). In the file, import pyweath to utilize its features (ex:from pyweath import *
). For more: example python program. - Run the program in terminal:
python3 my_program.py.
- Close virtual environment when done:
exit
If using the package directly in terminal:
- Create and enter a pipenv virtual environment as seen above in steps 1 & 2.
- Run our package directly from the command line:
python3 -m pyweath
. This should run the code located inside__main__.py
, in the src folder. - Close virtual environment when done:
exit
Contributing
- Clone this repo
git clone https://github.com/software-students-spring2024/3-python-package-exercise-team-pyday
- Create and enter virtual environment as seen above.
- Install package:
pipenv install pyweath
- Install the necessary dependencies:
pipenv install pytest build twine requests matplotlib numpy
- If you wish to run the unit tests provided:
pytest
Contributors
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
File details
Details for the file pyweath-1.0.2.tar.gz
.
File metadata
- Download URL: pyweath-1.0.2.tar.gz
- Upload date:
- Size: 44.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d43ce93452e5d7896cf9dd37e27ee52ffab5a87393b8d5dd6dba90f297f0268e |
|
MD5 | 404b0d62148d9d50da092daccd186e23 |
|
BLAKE2b-256 | 2791da79ac10c280acfd3342344a97316804211c90b88c66228ede6de9517a8f |
File details
Details for the file pyweath-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: pyweath-1.0.2-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1610f372d0fa3009a7d18cb5c32ba0521393228abf258c9d1fa4e73053cec31b |
|
MD5 | abb8dd5d2981a67bf633c70fc8b088cb |
|
BLAKE2b-256 | 10bc6e42f0288d50a4bb971853b2225d1a474099cd94677e6a69939e7c200c96 |