Skip to main content

A simple wrapper around the AirNow API

Project description

CI codecov Documentation Status

python-airnow

A simple wrapper around AirNow API.

Install

pip install -U python-airnow

Example

import airnow

AIRNOW_API_KEY = '{INSERT_API_KEY}'
air = airnow.AirNow(AIRNOW_API_KEY)

obsrvtns = air.getObservationsByZipCode(20002)
print(obsrvtns)
# [
#     AirNowObservation(
#         DateTime=datetime.datetime(2021, 9, 7, 12, 0, tzinfo=tzoffset('EST', -18000)),
#         ReportingArea='Metropolitan Washington',
#         ParameterName='O3',
#         AQI=46
#     ),
#     AirNowObservation(
#         DateTime=datetime.datetime(2021, 9, 7, 12, 0, tzinfo=tzoffset('EST', -18000)),
#         ReportingArea='Metropolitan Washington',
#         ParameterName='PM2.5',
#         AQI=4
#     )
# ]

frcst = air.getForecastByLatLong(38.919, -77.013, date=datetime.datetime(2021,9,7))
print(frcst)
# [
#     AirNowForecast(
#       DateForecast=datetime.date(2021, 9, 7),
#       ReportingArea='Metropolitan Washington',
#       ParameterName='O3',
#       AQI=61
#     ),
#     AirNowForecast(
#       DateForecast=datetime.date(2021, 9, 7),
#       ReportingArea='Metropolitan Washington',
#       ParameterName='PM2.5',
#       AQI=38),
#     AirNowForecast(
#       DateForecast=datetime.date(2021, 9, 8),
#       ReportingArea='Metropolitan Washington',
#       ParameterName='O3',
#       AQI=50
#     ),
#     AirNowForecast(
#       DateForecast=datetime.date(2021, 9, 8),
#       ReportingArea='Metropolitan Washington',
#       ParameterName='PM2.5',
#       AQI=46
#     ),
#     AirNowForecast(
#       DateForecast=datetime.date(2021, 9, 9),
#       ReportingArea='Metropolitan Washington',
#       ParameterName='O3',
#       AQI=46
#     ),
#     AirNowForecast(
#       DateForecast=datetime.date(2021, 9, 9),
#       ReportingArea='Metropolitan Washington',
#       ParameterName='PM2.5',
#       AQI=33
#     )
# ]

Links

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

python-airnow-0.1.1.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

python_airnow-0.1.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page