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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file python-airnow-0.1.1.tar.gz.

File metadata

  • Download URL: python-airnow-0.1.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.6 Linux/5.13.13-200.fc34.x86_64

File hashes

Hashes for python-airnow-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5ff8212a489c565861f114abfcaef02f22210f1602fe712e346cb4c0d8e020a4
MD5 55ba678a39baab7a8a4117fdbdaeaa8c
BLAKE2b-256 53d24d9d6336b282b197ba54e0ad6b9c654d5614bde609cc5b19582450eb9ba0

See more details on using hashes here.

File details

Details for the file python_airnow-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_airnow-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.6 Linux/5.13.13-200.fc34.x86_64

File hashes

Hashes for python_airnow-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7be3ada60e9cac1a10d693152c54f7ad94099288990d706167d8606fcf4ed3d4
MD5 8b6e8240f6d491b968622e90a2b27b7a
BLAKE2b-256 73d5b6e13a7149736cd2f2df3f60ff184cba1c560d6fb97d8e621d9077f183c8

See more details on using hashes here.

Supported by

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