A simple wrapper around the AirNow API
Project description
python-airnow
A wrapper around AirNow API.
Install
pip install -U python-airnow
Example
import airnow
import datetime
AIRNOW_API_KEY = '{INSERT_API_KEY}'
air = airnow.AirNow(AIRNOW_API_KEY)
obsrvtns = air.observation.by_zip_code(20002)
print(obsrvtns)
# [
# AirNowObservation(
# date_time=datetime.datetime(2021, 9, 7, 12, 0, tzinfo=tzoffset('EST', -18000)),
# reporting_area='Metropolitan Washington',
# parameter_name='O3',
# aqi=46
# ),
# AirNowObservation(
# date_time=datetime.datetime(2021, 9, 7, 12, 0, tzinfo=tzoffset('EST', -18000)),
# reporting_area='Metropolitan Washington',
# parameter_name='PM2.5',
# aqi=4
# )
# ]
frcst = air.forecast.by_lat_long(38.919, -77.013, date=datetime.datetime(2021,9,7))
print(frcst)
# [
# AirNowForecast(
# date_forecast=datetime.date(2021, 9, 7),
# reporting_area='Metropolitan Washington',
# parameter_name='O3',
# aqi=61
# ),
# AirNowForecast(
# date_forecast=datetime.date(2021, 9, 7),
# reporting_area='Metropolitan Washington',
# parameter_name='PM2.5',
# aqi=38),
# AirNowForecast(
# date_forecast=datetime.date(2021, 9, 8),
# reporting_area='Metropolitan Washington',
# parameter_name='O3',
# aqi=50
# ),
# AirNowForecast(
# date_forecast=datetime.date(2021, 9, 8),
# reporting_area='Metropolitan Washington',
# parameter_name='PM2.5',
# aqi=46
# ),
# AirNowForecast(
# date_forecast=datetime.date(2021, 9, 9),
# reporting_area='Metropolitan Washington',
# parameter_name='O3',
# aqi=46
# ),
# AirNowForecast(
# date_forecast=datetime.date(2021, 9, 9),
# reporting_area='Metropolitan Washington',
# parameter_name='PM2.5',
# aqi=33
# )
# ]
Links
- Documentation: https://python-airnow.readthedocs.io/
- PyPI Releases: https://pypi.org/project/python-airnow/
- Source Code: https://github.com/ronnie-llamado/python-airnow/
- Issue Tracker: https://github.com/ronnie-llamado/python-airnow/issues/
- AirNow API Documentation: https://docs.airnowapi.org
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
python-airnow-1.0.0a0.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for python_airnow-1.0.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 604078c38f541b47cb0c1137757d68804f5cdbaa4457febe8e179893a6d95f39 |
|
MD5 | cfe7183ed285748b2a092cce6b50ae3b |
|
BLAKE2b-256 | c739cf49dcf342d008cf07da7d35c8c07b9508ae20647447c22995c146bb490b |