Metadata-Version: 2.1
Name: airpyllution
Version: 1.1.2
Summary: A package which  provides various functionalities on air pollution data.
License: MIT
Author: Christopher Alexander, Daniel King, Mel Liow
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: DateTime (>=4.3,<5.0)
Requires-Dist: altair (>=4.2.0,<5.0.0)
Requires-Dist: altair-viewer (>=0.4.0,<0.5.0)
Requires-Dist: black (>=21.12b0,<22.0)
Requires-Dist: mock (>=4.0.3,<5.0.0)
Requires-Dist: numpy (>=1.22.1,<2.0.0)
Requires-Dist: pandas (>=1.3.5,<2.0.0)
Requires-Dist: plotly (>=5.5.0,<6.0.0)
Requires-Dist: python-dotenv (>=0.19.2,<0.20.0)
Requires-Dist: requests (>=2.27.1,<3.0.0)
Requires-Dist: responses (>=0.17.0,<0.18.0)
Requires-Dist: vega-datasets (>=0.9.0,<0.10.0)
Description-Content-Type: text/markdown

# airpyllution
[![codecov](https://codecov.io/gh/UBC-MDS/airpyllution/branch/main/graph/badge.svg?token=c6vEGpbs3h)](https://codecov.io/gh/UBC-MDS/airpyllution)
[![build](https://github.com/UBC-MDS/airpyllution/actions/workflows/build.yml/badge.svg)](https://github.com/UBC-MDS/airpyllution/actions/workflows/build.yml)
[![deploy](https://github.com/UBC-MDS/airpyllution/actions/workflows/deploy.yml/badge.svg)](https://github.com/UBC-MDS/airpyllution/actions/workflows/deploy.yml)

A package for visualizing or obtaining future, historic and current air pollution data using the [OpenWeather API](https://openweathermap.org).

## Summary
This package enables users to explore air pollution levels in locations around the world.
Using the [Air Pollution API](https://openweathermap.org/api/air-pollution), this package provides 3 functions that help to visualise present, future and historic air pollution data.  

The data returned from the API includes the polluting gases such as Carbon monoxide (CO), Nitrogen monoxide (NO), Nitrogen dioxide (NO2), Ozone (O3), Sulphur dioxide (SO2), Ammonia (NH3), and particulates (PM2.5 and PM10).

Using the OpenWeatherMap API requires sign up to gain access to an API key.   
For more information about API call limits and API care recommendations please visit the [OpenWeather how to start](https://openweathermap.org/appid) page.
## Functions
The functions are as follows:
- `get_air_pollution()`
- `get_pollution_history()`
- `get_pollution_forecast()`

### `get_air_pollution()`
Fetches the air pollution levels based on a location. Based on the values of the polluting gases, this package uses the [Air Quality Index](https://en.wikipedia.org/wiki/Air_quality_index#CAQI) to determine the level of pollution for the location and produces a coloured map of the area displaying the varying regions of air quality.

### `get_pollution_history()`
Requires a start and end date and fetches historic air pollution data for a specific location. The function returns a data frame with the values of the polluting gases over the specified date range.

### `get_pollution_forecast()`
Fetches air pollution data for the next 5 days for a specific location. The function returns a time series plot of the predicted pollution levels.


Although there is an abundance of python weather packages and APIs in the Python ecosystem (e.g. [python-weather](https://pypi.org/project/python-weather/), [weather-forecast](https://pypi.org/project/weather-forecast/)), this particular package looks at specifically air pollution data and uses the Air Pollution API from OpenWeather. This is a unique package with functionality that (we believe) has not been made before.

## Installation

```bash
$ pip install --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple airpyllution
```

## Usage
[![readthedocs](https://readthedocs.org/projects/pip/badge/?version=latest)](https://airpyllution.readthedocs.io/en/latest/)

1. Create an OpenWeatherMap API key
2. Install airpyllution
3. Refer to [ReadTheDocs](https://airpyllution.readthedocs.io/en/latest/) for a usage guide and examples.

Using the `get_air_pollution` function you can generate interactive maps containing current pollution data by location:
![](docs/air-pollution-map.png)

Using the `get_pollution_forecast` function you can generate time-series scatterplots of forecasted air pollution data:
![](docs/forecast-example.png)
## Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Contributors 
- Christopher Alexander (@christopheralex)
- Daniel King (@danfke)
- Mel Liow (@mel-liow)

## License

`airpyllution` was created by Christopher Alexander, Daniel King, Mel Liow. It is licensed under the terms of the MIT license.

## Credits

`airpyllution` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).

