Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

purple_air_api (PAA)

This is a wrapper for the PurpleAirAPI (PAA) with a C++ backend and SWIG bindings for Python, JavaScript, C#, and Go. Details of the API can be found using this link: https://api.purpleair.com/#api-welcome

To use the PurpleAirAPI (PAA), API keys are required. You can get API keys by sending an email to contact@purpleair.com with a first and last name to assign them to.

New in CalSemVer: The library now uses a high-performance C++ backend with SWIG bindings, providing native performance while maintaining full backward compatibility with existing Python code.

Python Tests JavaScript Tests C# Tests Go Tests Black Sphinx Docs

Codecov SonarCloud Quality Gate SonarCloud Security Rating SonarCloud Maintainability Rating CodeQL

PyPI Version TestPyPI Version PyPI Downloads npm Version npm Downloads PyPI Distributions TestPyPI Distributions

License

How to Support This Project

Buy Me A Coffee

Purpose

This package is designed to be used for making tools around the PurpleAir API.

For example, PAA data loggers - https://github.com/carlkidcrypto/purpleair_data_logger

Requirements

  • Python 3.10 or higher (supports Python 3.10, 3.11, 3.12, 3.13, and 3.14)

  • requests library

Installation

Prerequisites

The C++ backend requires:

  • Linux/Ubuntu: sudo apt-get install build-essential libcurl4-openssl-dev swig meson ninja-build

  • macOS: brew install curl swig meson ninja

  • Windows: Visual Studio C++, SWIG, curl library, Meson, and Ninja

Installation via pip

You can install the PurpleAir API via pip:

python3 -m pip install purpleair_api

Installation from source

You can also install PurpleAir API by cloning down this repo:

git clone https://github.com/carlkidcrypto/purpleair_api.git
cd purpleair_api

Multi-Language Support

The repository is structured to support multiple languages:

PurpleAirAPI Usage Example

First we need to import the PurpleAir API (PAA):

from purpleair_api.PurpleAirAPI import PurpleAirAPI

Next we need to make an instance of PAA:

my_paa = PurpleAirAPI(your_api_read_key, your_api_write_key, [your_ipv4_address])

Now you can use that PAA instance to do things like:

retval = my_paa.request_sensor_data(1234)

PurpleAirReadAPI Usage Example

First we need to import the PurpleAirReadAPI:

from purpleair_api.PurpleAirReadAPI import PurpleAirReadAPI

Now we need to make an instance of it:

my_paa = PurpleAirReadAPI(api_read_key)

Now we can use that instance to do things like:

retval = my_paa.request_multiple_sensors_data("name")

PurpleAirWriteAPI Usage Example

First we need to import the PurpleAirWriteAPI:

from purpleair_api.PurpleAirWriteAPI import PurpleAirWriteAPI

Now we need to make an instance of it:

my_paa = PurpleAirWriteAPI(api_write_key)

Now we can use that instance to do things like:

retval = my_paa.post_create_member(group_id=1234, sensor_index=5678)

PurpleAirLocalAPI Usage Example

First we need to import the PurpleAirLocalAPI:

from purpleair_api.PurpleAirLocalAPI import PurpleAirLocalAPI

Now we need to make an instance of it:

my_paa = PurpleAirLocalAPI(["ipv4_address"])

Now we can use that instance to do things like:

retval = my_paa.request_local_sensor_data()

Tests

Refer to the test README

Documentation

Full API documentation is available at https://carlkidcrypto.github.io/purpleair_api/


This content was generated by AI and reviewed by humans. Mistakes may still occur. PRs for corrections are welcome.

Matter Device Converter (Matter 1.5.1)

Map PurpleAir sensor data to Matter device type structures for use with Matter-compatible ecosystems (Apple Home, Google Home, Alexa, SmartThings, Home Assistant Matter integration).

Supports Matter 1.5.1 Air Quality Sensor (Device Type 0x002D), Temperature Sensor, and Environmental Sensor device types with full EPA AQI calculation.

from purpleair_api.PurpleAirReadAPI import PurpleAirReadAPI
from purpleair_api.PurpleAirMatterConverter import PurpleAirMatterConverter

pa = PurpleAirReadAPI("YOUR_READ_API_KEY")
raw = pa.request_sensor_data(282168)

matter_device = PurpleAirMatterConverter.to_air_quality_sensor(raw)
print(matter_device["air_quality_summary"])
# {'epa_aqi': 68, 'epa_category': 'Moderate',
#  'matter_air_quality_rating': 'GOOD', ...}

See the Matter implementation guide at sphinx_docs_build/source/matter_implementation.rst or docs/html/matter_implementation.html after building, or read the rendered guide online at https://carlkidcrypto.github.io/purpleair_api/matter_implementation.html. The API reference remains available at sphinx_docs_build/source/PurpleAirMatterConverter.rst.

References:

Metadata

Release files for purpleair-api 2026.11.24b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for purpleair-api 2026.11.24b0
File Size Uploaded Provenance Actions
purpleair_api-2026.11.24b0.tar.gz 73.0 kB With provenance Details for purpleair_api-2026.11.24b0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for purpleair-api 2026.11.24b0
File Actions
purpleair_api-2026.11.24b0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for purpleair_api-2026.11.24b0-cp313-cp313-win_amd64.whl
purpleair_api-2026.11.24b0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for purpleair_api-2026.11.24b0-cp313-cp313-manylinux_2_28_x86_64.whl
purpleair_api-2026.11.24b0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for purpleair_api-2026.11.24b0-cp313-cp313-macosx_11_0_arm64.whl
purpleair_api-2026.11.24b0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for purpleair_api-2026.11.24b0-cp312-cp312-win_amd64.whl
purpleair_api-2026.11.24b0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for purpleair_api-2026.11.24b0-cp312-cp312-manylinux_2_28_x86_64.whl
purpleair_api-2026.11.24b0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for purpleair_api-2026.11.24b0-cp312-cp312-macosx_11_0_arm64.whl
purpleair_api-2026.11.24b0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for purpleair_api-2026.11.24b0-cp311-cp311-win_amd64.whl
purpleair_api-2026.11.24b0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for purpleair_api-2026.11.24b0-cp311-cp311-manylinux_2_28_x86_64.whl
purpleair_api-2026.11.24b0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for purpleair_api-2026.11.24b0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 16.1 MB

Release files / purpleair_api-2026.11.24b0.tar.gz

Download URL purpleair_api-2026.11.24b0.tar.gz
Size 73.0 kB
Tags Source
SHA-256 checksum
How to use checksums
38e361ad491418fadeab25a320339db41813b97c4977b25c1d090d400e4a1cd9
BLAKE2b-256 checksum
How to use checksums
b837225e74ce8e370f5dea98053f176cacf32862869cb21b7ffdf5b1d61ac29f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp313-cp313-win_amd64.whl

Download URL purpleair_api-2026.11.24b0-cp313-cp313-win_amd64.whl
Size 807.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
bf12bd480b0f9d659d8960cb42ae596480394eb465bfc5fce224d24890d2e47a
BLAKE2b-256 checksum
How to use checksums
ff2718aecde2b31348addd9d7d048a22396f2e43259ebcffc5caa9abc6db2e7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL purpleair_api-2026.11.24b0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 4.4 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9201d75d12ab5fb1325e3a8e82bc25fbe33663b18ee7612dd7f879573014a9e8
BLAKE2b-256 checksum
How to use checksums
f7e47d90c45831999bd1bf84738ee091c1e52a584dd7172f27aa11cf6a0a93be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp313-cp313-macosx_11_0_arm64.whl

Download URL purpleair_api-2026.11.24b0-cp313-cp313-macosx_11_0_arm64.whl
Size 119.3 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2f2656048d168b6d42d3785a08f1ce77843336fd2dbdbe50c11b2ef26b52ec8a
BLAKE2b-256 checksum
How to use checksums
6106252ab05cb680293461155c9a58d70f295de1269a43104a7f074e7bcefc6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp312-cp312-win_amd64.whl

Download URL purpleair_api-2026.11.24b0-cp312-cp312-win_amd64.whl
Size 807.2 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
98cc867f1a385bcd8877340bce2f742b13dae3688c23140f65d0f335c9891091
BLAKE2b-256 checksum
How to use checksums
b24295bf47f26337abff5b3813b367ae4a76504d71cddf8b3fd0e085b80382e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL purpleair_api-2026.11.24b0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 4.4 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
46c43198221084594343bb7960f17c7df1a06af066d205132f9f6eda27e4bbad
BLAKE2b-256 checksum
How to use checksums
bdc3391524138c514c957332251bde4db5a5a5c14178b100976fed8937726609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp312-cp312-macosx_11_0_arm64.whl

Download URL purpleair_api-2026.11.24b0-cp312-cp312-macosx_11_0_arm64.whl
Size 119.7 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
af07a5f7110d174f4a9d61c21537fd78b5b26e242b951c0ee6f5e2e1cbaadf76
BLAKE2b-256 checksum
How to use checksums
c0d2a9e7057790b5255857ac3a5c8a6a6f2eb5fa11a448446ccdcb8a8269dddf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp311-cp311-win_amd64.whl

Download URL purpleair_api-2026.11.24b0-cp311-cp311-win_amd64.whl
Size 807.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c81fe134204844726d088381a4f556e72028409f2f496b44710f272584a48554
BLAKE2b-256 checksum
How to use checksums
e1b397ef02019844e006573af268de3dca4bfd85bc23d7ecb3ceaa76ed5bb374
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL purpleair_api-2026.11.24b0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 4.4 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
152b183dfb7d7ba6bcf9eb7727011c8b6842092070eda811d1f8b584ded22c99
BLAKE2b-256 checksum
How to use checksums
894dffef1c84942b4f5d5783f9b031cdcc144a2068e633c86dcafa254805c133
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / purpleair_api-2026.11.24b0-cp311-cp311-macosx_11_0_arm64.whl

Download URL purpleair_api-2026.11.24b0-cp311-cp311-macosx_11_0_arm64.whl
Size 119.2 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
659f02a48b6e1c8a1465a34aedfaf60473405089af2703b9339aa389f728f968
BLAKE2b-256 checksum
How to use checksums
3a2629e11ac4fbc25b1f8bd37625d403b3809ae27898341496dd3a4517df4e98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for purpleair-api 2026.11.24b0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 10 files in this release have been uploaded with provenance metadata.

Select from 10 files

Attestation for purpleair_api-2026.11.24b0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page