PurpleAirAPI module

The main entry point for the PurpleAir API wrapper. This module automatically loads the appropriate submodules (Read, Write, Local) based on the API keys and configuration provided during initialization.

Usage Example

from purpleair_api.PurpleAirAPI import PurpleAirAPI

# Initialize with all API types
paa = PurpleAirAPI(
    api_read_key="your_read_key",
    api_write_key="your_write_key",
    ipv4_address=["192.168.1.100"]
)

# Now you can use read, write, and local methods
sensor_data = paa.request_sensor_data(12345)

API Reference

Copyright 2024 carlkidcrypto, All rights reserved. A python3 class designed to fetch data from Purple Air’s new API. https://api.purpleair.com/#api-welcome

class PurpleAirAPI.PurpleAirAPI(your_api_read_key=None, your_api_write_key=None, your_ipv4_address=None)

Bases: PurpleAirReadAPI, PurpleAirWriteAPI, PurpleAirLocalAPI

The PurpleAirAPI class designed to send valid PurpleAirAPI requests.

property get_api_key_last_checked

A method to return the timestamp of when the API read/write keys were last checked.

property get_api_key_type

A method to return the API key types being used.

property get_api_versions

A method to return the API versions being used for both read/write keys.