| File | Date | Author | Commit |
|---|---|---|---|
| .github | 2025-01-08 |
|
[c1c858] Feature/py versions (#122) |
| .vscode | 2023-11-12 |
|
[170b5b] Feature/minor improvements to use helpers (#24) |
| diagrams | 2024-09-26 |
|
[e91e1f] Prep for 1.2.0 (#100) |
| docs | 2024-09-26 |
|
[e91e1f] Prep for 1.2.0 (#100) |
| purpleair_api | 2024-09-26 |
|
[e91e1f] Prep for 1.2.0 (#100) |
| sphinx_docs_build | 2025-01-08 |
|
[c1c858] Feature/py versions (#122) |
| tests | 2025-01-08 |
|
[4150d7] Bump coverage from 7.6.9 to 7.6.10 (#121) |
| .gitattributes | 2023-02-16 |
|
[81993d] Feature/move latest code over (#2) |
| .gitignore | 2024-09-19 |
|
[a2691c] 75 add new api endpoints (#95) |
| LICENSE | 2024-01-05 |
|
[d184df] Release/v1.1.3 (#32) |
| README.md | 2025-01-08 |
|
[c1c858] Feature/py versions (#122) |
| requirements.txt | 2024-10-11 |
|
[345968] Bump black from 24.8.0 to 24.10.0 (#105) |
| setup.cfg | 2025-01-08 |
|
[c1c858] Feature/py versions (#122) |
| setup.py | 2024-09-19 |
|
[a2691c] 75 add new api endpoints (#95) |
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.
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
You can install the PurpleAir API via pip.
python3 -m pip install purple_air_api
You can install PurpleAir API by cloning down this repo.
git clone https://github.com/carlkidcrypto/purple_air_api.git
cd purple_air_api
python3 setup.py install
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)
Note: PurpleAirAPI is the main entry point. It will load read, write, and local submodules
based on the parameters that are passed in upon construction. If you wish to only use a
small piece of PurpleAirAPI then see the examples below.
First we need to import the PurpleAirReadAPI.
from purpleair_api.PurpleAirReadAPI import PurpleAirReadAPI
Now we need to make an instance if 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")
First we need to import the PurpleAirWriteAPI.
from purpleair_api.PurpleAirWriteAPI import PurpleAirWriteAPI
Now we need to make an instance if it.
my_paa = PurpleAirWriteAPI(api_write_key)
Now we can use that instance to do things like...
retval = my_paa.post_create_member(1234)
First we need to import the PurpleAirLocalAPI.
from purpleair_api.PurpleAirLocalAPI import PurpleAirLocalAPI
Now we need to make an instance if it.
my_paa = PurpleAirLocalAPI(["ipv4_address"])
Now we can use that instance to do things like...
retval = my_paa.request_local_sensor_data()
Refer to the test readme