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.

PyPI Distributions TestPyPI Distributions Black Tests Total download count Latest release download count

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.11a2

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.11a2
File Size Uploaded Provenance Actions
purpleair_api-2026.11.11a2.tar.gz 72.3 kB With provenance Details for purpleair_api-2026.11.11a2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for purpleair-api 2026.11.11a2
File Actions
purpleair_api-2026.11.11a2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for purpleair_api-2026.11.11a2-cp313-cp313-win_amd64.whl
purpleair_api-2026.11.11a2-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.11a2-cp313-cp313-manylinux_2_28_x86_64.whl
purpleair_api-2026.11.11a2-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for purpleair_api-2026.11.11a2-cp313-cp313-macosx_11_0_arm64.whl
purpleair_api-2026.11.11a2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for purpleair_api-2026.11.11a2-cp312-cp312-win_amd64.whl
purpleair_api-2026.11.11a2-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.11a2-cp312-cp312-manylinux_2_28_x86_64.whl
purpleair_api-2026.11.11a2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for purpleair_api-2026.11.11a2-cp312-cp312-macosx_11_0_arm64.whl
purpleair_api-2026.11.11a2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for purpleair_api-2026.11.11a2-cp311-cp311-win_amd64.whl
purpleair_api-2026.11.11a2-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.11a2-cp311-cp311-manylinux_2_28_x86_64.whl
purpleair_api-2026.11.11a2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for purpleair_api-2026.11.11a2-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 16.1 MB

Release files / purpleair_api-2026.11.11a2.tar.gz

Download URL purpleair_api-2026.11.11a2.tar.gz
Size 72.3 kB
Tags Source
SHA-256 checksum
How to use checksums
188303e34942ed07e02d381fd5e79fc06e82bce5d61ee2b0561c980774d13157
BLAKE2b-256 checksum
How to use checksums
a6e9452ee6b5ef6f89bb206dd86d20a30dbfb4316660f9cd8321e3df44b7ec5e
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp313-cp313-win_amd64.whl

Download URL purpleair_api-2026.11.11a2-cp313-cp313-win_amd64.whl
Size 806.4 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
cd2da4c1a8c3251a4f911a4b12f880bbbd014a9e71dc6210899770111359510a
BLAKE2b-256 checksum
How to use checksums
92c4325af5cb3ef7f645ce5ee2a6af373b322a7fc0d53dd5b5ec7571eb501b6b
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL purpleair_api-2026.11.11a2-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
3f24af5257bae2ebb3a8353a0c7fefdb16caa0d151c0e2a040086973346b5b39
BLAKE2b-256 checksum
How to use checksums
c11d3e24a76ae3c0cd7761a8c4425136ea6cb641cb73e3126784fe851b393af3
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp313-cp313-macosx_11_0_arm64.whl

Download URL purpleair_api-2026.11.11a2-cp313-cp313-macosx_11_0_arm64.whl
Size 118.7 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
09fbcd15997466634129f8d39ce9d4ae61c8f22f909a59b3897f4f35f584f879
BLAKE2b-256 checksum
How to use checksums
21b3cca076c339881a839b2975304aaa972be8281026b535b3bd32f762e69a10
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp312-cp312-win_amd64.whl

Download URL purpleair_api-2026.11.11a2-cp312-cp312-win_amd64.whl
Size 806.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
53546b5fc692ee4a9d260d30c7bec7919f41d70df02e87c433f18aea8a9ef61f
BLAKE2b-256 checksum
How to use checksums
42cf079e3a565d677c40d4b4a0a6d76e65154c82d619b8b93bee6d525978314d
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL purpleair_api-2026.11.11a2-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
f11e636c5cde2f002c418904c8851cfa60a8769340cb4e98780ef60500ca4ad3
BLAKE2b-256 checksum
How to use checksums
41291bf854024a43c204322d19af7e9f7f132285f8f151b0e1ec6d4d3549f4bf
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp312-cp312-macosx_11_0_arm64.whl

Download URL purpleair_api-2026.11.11a2-cp312-cp312-macosx_11_0_arm64.whl
Size 119.0 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7a22b8911725d6cf9d18324a586ebfdcc672aeb9243fd0d9daea165b586e03bd
BLAKE2b-256 checksum
How to use checksums
ee9198aa62f041c203f7ed6d83d78ccfe16d0a8c9b2ec09b140be3949ac714b7
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp311-cp311-win_amd64.whl

Download URL purpleair_api-2026.11.11a2-cp311-cp311-win_amd64.whl
Size 806.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
ebca5a24b94617cfda5457466e9f6665e2aab9ac085d66ac77efdc7f3f160e3a
BLAKE2b-256 checksum
How to use checksums
2b60c3bf835ad0f52832506dbbe3b7b1ef9d2d1299a21c81420c7c33ca0e0689
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL purpleair_api-2026.11.11a2-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
2b1c95f60d38b3f3fc771348f7df59dc51dd9442238f719714e649f064393e03
BLAKE2b-256 checksum
How to use checksums
ee3ab639fc38e95b97efda8496213f9a7634636d8e303c0768b981af650c9709
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 12, 2026.

Transparency log

Release files / purpleair_api-2026.11.11a2-cp311-cp311-macosx_11_0_arm64.whl

Download URL purpleair_api-2026.11.11a2-cp311-cp311-macosx_11_0_arm64.whl
Size 118.6 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
62a6c9e0be11b133083b3269cfaeea0f114c7b3a42d60d1bdf795c2a10de366d
BLAKE2b-256 checksum
How to use checksums
7fe6175614342216ebd2d0b0f2bc084e8c5eeef2e1935aa0d073e16061e8c905
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 12, 2026.

Transparency log

Security for purpleair-api 2026.11.11a2

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.11a2.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 12, 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