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 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.22b0

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.22b0
File Size Uploaded Provenance Actions
purpleair_api-2026.11.22b0.tar.gz 72.9 kB With provenance Details for purpleair_api-2026.11.22b0.tar.gz

Built distributions (wheels)

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

Total release size: 16.1 MB

Release files / purpleair_api-2026.11.22b0.tar.gz

Download URL purpleair_api-2026.11.22b0.tar.gz
Size 72.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cdcf638ccd6a0e83e0d1ce18f7a96505795d464ba24c5d9c204a7e1d35b3cffe
BLAKE2b-256 checksum
How to use checksums
7ef2d771465fcb9e4c6b7ae3923cfb662a1093f4a021571bf92cfe87b25ec5dd
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-cp313-cp313-win_amd64.whl
Size 806.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
fb549a1ed43dd303cbcac4542c2bd511b1e5f545e76c5461cc33a7155c212b49
BLAKE2b-256 checksum
How to use checksums
465209bc6bd65b48c7cf15cdca76ab3ff611447440f167e9d4fe5cb536eab08d
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-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
cc8d3a6c5366c9a5526ebf8d33c5938249f5ff80c840d09eb63128840293601d
BLAKE2b-256 checksum
How to use checksums
358e0abc5f08c31d3f624d4cb3c03e8b226339450ef32df2097aa77f3ef9ae07
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-cp313-cp313-macosx_11_0_arm64.whl
Size 119.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
aca840c1d0915a721ad56715e723f2c81e51a324b855227a0d0f60eb912f906e
BLAKE2b-256 checksum
How to use checksums
22b1efc792b23cda512447f00a465bb449d0580a5bba52f294a57c3fae3f98b2
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-cp312-cp312-win_amd64.whl
Size 807.1 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4c6b10a6a53b097a8e1e3d9d325f62cb26a788f64295d5cd3cea86c42d79bc55
BLAKE2b-256 checksum
How to use checksums
127967bdf947cba028d44f78a9445e50177259672ee9ffa920a4bf6e343b2531
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-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
160b89e8900ca35c4ed383cedb4062b2d70f3236787961de71f642c5ab00666c
BLAKE2b-256 checksum
How to use checksums
d8b8e80bc988434a9098889dd4ae1c0d138524787ae68c8ba426625416ca9344
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-cp312-cp312-macosx_11_0_arm64.whl
Size 119.6 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0b08278b004daeaa6d909adcda4b648af1a3d4800730ff850ad3d13a393712f9
BLAKE2b-256 checksum
How to use checksums
fa9eb7160715676fcf2953a037a5dd36309864aebb44dbea7f02b7191c93a567
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-cp311-cp311-win_amd64.whl
Size 807.3 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c8bbd519d938249b9ff20eca31f5eaa082bd5e6475fbeb5e9f9141a7b29573e0
BLAKE2b-256 checksum
How to use checksums
e63b02ed33cdfb6468968a6a64a3c8efd55c72573728284aefa0952f82dc22e0
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-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
6923ab933f9d6c683caa9f8b98dc6c49a9b5098f4a4ac9f647f496cfe36d6576
BLAKE2b-256 checksum
How to use checksums
e96944d7120286f8896ca101c592458fc1e0aba4147933904caf74ac686c0f9d
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 23, 2026.

Transparency log

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

Download URL purpleair_api-2026.11.22b0-cp311-cp311-macosx_11_0_arm64.whl
Size 119.1 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
aa3037d06a1870970e82a503c43967c810b033458eabbf99e8631ab03150e6e0
BLAKE2b-256 checksum
How to use checksums
02df465d356047717c79c27bc7a95f0b3e79bfca37373e2680ab96c9b9fa2c32
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 23, 2026.

Transparency log

Security for purpleair-api 2026.11.22b0

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.22b0.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 23, 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