No project description provided
Project description
This is a python3 wrapper for the new PurpleAirAPI (PAA). 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.
How to Support This Project
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
You can install the PurpleAir API via pip:
python3 -m pip install purple_air_api
You can also install PurpleAir API by cloning down this repo:
git clone https://github.com/carlkidcrypto/purpleair_api.git
cd purpleair_api
python3 setup.py install
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(1234)
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file purpleair_api-1.4.1.tar.gz.
File metadata
- Download URL: purpleair_api-1.4.1.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aae87b9e86e981912d9845b157d1db0e95f847a72948ac928c480c90f9a650b
|
|
| MD5 |
540025772cd70e9bdc50d8402eaa15bb
|
|
| BLAKE2b-256 |
3620ddc422607ca60a937b55a487d801663a5cca45ccd8bbcb44bd8c57339c92
|
Provenance
The following attestation bundles were made for purpleair_api-1.4.1.tar.gz:
Publisher:
build_and_publish_to_pypi.yml on carlkidcrypto/purpleair_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
purpleair_api-1.4.1.tar.gz -
Subject digest:
4aae87b9e86e981912d9845b157d1db0e95f847a72948ac928c480c90f9a650b - Sigstore transparency entry: 1370221199
- Sigstore integration time:
-
Permalink:
carlkidcrypto/purpleair_api@e6bb60c246084bcc5b640af29a0f84269b844626 -
Branch / Tag:
refs/tags/v1.4.1 - Owner: https://github.com/carlkidcrypto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_and_publish_to_pypi.yml@e6bb60c246084bcc5b640af29a0f84269b844626 -
Trigger Event:
release
-
Statement type: