# purple_air_api (PAA)
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.
| [![PyPI Distributions](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_pypi.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_pypi.yml) | [![TestPyPI Distributions](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_test_pypi.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_test_pypi.yml) | [![Black](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/black.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/black.yml) |
| --------------- | --------------- | --------------- |
| [![Tests](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml) | [![total download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/total.svg?style=flat-square&label=all%20downloads)](https://github.com/carlkidcrypto/purpleair_api/releases) | [![latest release download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/v1.1.2/total.svg?style=flat-square)](https://github.com/carlkidcrypto/purpleair_api/releases/tag/v1.1.2) |
| --------------- | --------------- | --------------- |
## How to Support This Project
<a href="https://www.buymeacoffee.com/carlkidcrypto" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
## 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>
## Installation
You can install the PurpleAir API via pip.
```bash
python3 -m pip install purple_air_api
```
You can install PurpleAir API by cloning down this repo.
```bash
git clone https://github.com/carlkidcrypto/purple_air_api.git
cd purple_air_api
python3 setup.py install
```
## PurpleAirAPI Usage Example
First we need to import the PurpleAir API (PAA)
```python
from purpleair_api.PurpleAirAPI import PurpleAirAPI
```
Next we need to make an instance of PAA.
```python
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...
```python
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.
## PurpleAirReadAPI Usage Example
First we need to import the PurpleAirReadAPI.
```python.
from purpleair_api.PurpleAirReadAPI import PurpleAirReadAPI
```
Now we need to make an instance if it.
```python
my_paa = PurpleAirReadAPI(api_read_key)
```
Now we can use that instance to do things like...
```python
retval = my_paa.request_multiple_sensors_data("name")
```
## PurpleAirWriteAPI Usage Example
First we need to import the PurpleAirWriteAPI.
```python.
from purpleair_api.PurpleAirWriteAPI import PurpleAirWriteAPI
```
Now we need to make an instance if it.
```python
my_paa = PurpleAirWriteAPI(api_write_key)
```
Now we can use that instance to do things like...
```python
retval = my_paa.post_create_member(1234)
```
## PurpleAirLocalAPI Usage Example
First we need to import the PurpleAirLocalAPI.
```python.
from purpleair_api.PurpleAirLocalAPI import PurpleAirLocalAPI
```
Now we need to make an instance if it.
```python
my_paa = PurpleAirLocalAPI(["ipv4_address"])
```
Now we can use that instance to do things like...
```python
retval = my_paa.request_local_sensor_data()
```
## Tests
Refer to the test [readme](/tests/README.md)
Raw data
{
"_id": null,
"home_page": "https://github.com/carlkidcrypto/purpleair_api",
"name": "purpleair-api",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "purpleair_api,purple air api,purple_air,purple air,purpleair_sensor,purpleair sensor,purpleair-sensor",
"author": "Carlos Santos",
"author_email": "dose.lucky.sake@cloak.id",
"download_url": "https://files.pythonhosted.org/packages/d0/70/6e4ddbb8c519a58c48468b6d8787c5fcc47943df40318634d78a80c6ef86/purpleair_api-1.1.4.tar.gz",
"platform": "Windows 32/64",
"description": "# purple_air_api (PAA)\n\nThis 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>\nTo 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.\n\n| [![PyPI Distributions](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_pypi.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_pypi.yml) | [![TestPyPI Distributions](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_test_pypi.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/build_and_publish_to_test_pypi.yml) | [![Black](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/black.yml/badge.svg)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/black.yml) |\n| --------------- | --------------- | --------------- |\n\n| [![Tests](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/carlkidcrypto/purpleair_api/actions/workflows/tests.yml) | [![total download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/total.svg?style=flat-square&label=all%20downloads)](https://github.com/carlkidcrypto/purpleair_api/releases) | [![latest release download count](https://img.shields.io/github/downloads/carlkidcrypto/purpleair_api/v1.1.2/total.svg?style=flat-square)](https://github.com/carlkidcrypto/purpleair_api/releases/tag/v1.1.2) |\n| --------------- | --------------- | --------------- |\n\n## How to Support This Project\n\n<a href=\"https://www.buymeacoffee.com/carlkidcrypto\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"></a>\n\n## Purpose\n\nThis package is designed to be used for making tools around the PurpleAir API.\n\nFor example, PAA data loggers - <https://github.com/carlkidcrypto/purpleair_data_logger>\n\n## Installation\n\nYou can install the PurpleAir API via pip.\n\n```bash\npython3 -m pip install purple_air_api\n```\n\nYou can install PurpleAir API by cloning down this repo.\n\n```bash\ngit clone https://github.com/carlkidcrypto/purple_air_api.git\ncd purple_air_api\npython3 setup.py install\n```\n\n## PurpleAirAPI Usage Example\n\nFirst we need to import the PurpleAir API (PAA)\n\n```python\nfrom purpleair_api.PurpleAirAPI import PurpleAirAPI\n```\n\nNext we need to make an instance of PAA.\n\n```python\nmy_paa = PurpleAirAPI(your_api_read_key, your_api_write_key, your_ipv4_address)\n```\n\nNow you can use that PAA instance to do things like...\n\n```python\nretval = my_paa.request_sensor_data(1234)\n```\n\n> Note: PurpleAirAPI is the main entry point. It will load read, write, and local submodules\nbased on the parameters that are passed in upon construction. If you wish to only use a\nsmall piece of PurpleAirAPI then see the examples below.\n\n## PurpleAirReadAPI Usage Example\n\nFirst we need to import the PurpleAirReadAPI.\n\n```python.\nfrom purpleair_api.PurpleAirReadAPI import PurpleAirReadAPI\n```\n\nNow we need to make an instance if it.\n\n```python\nmy_paa = PurpleAirReadAPI(api_read_key)\n```\n\nNow we can use that instance to do things like...\n```python\nretval = my_paa.request_multiple_sensors_data(\"name\")\n```\n\n## PurpleAirWriteAPI Usage Example\n\nFirst we need to import the PurpleAirWriteAPI.\n\n```python.\nfrom purpleair_api.PurpleAirWriteAPI import PurpleAirWriteAPI\n```\n\nNow we need to make an instance if it.\n\n```python\nmy_paa = PurpleAirWriteAPI(api_write_key)\n```\n\nNow we can use that instance to do things like...\n```python\nretval = my_paa.post_create_member(1234)\n```\n\n## PurpleAirLocalAPI Usage Example\n\nFirst we need to import the PurpleAirLocalAPI.\n\n```python.\nfrom purpleair_api.PurpleAirLocalAPI import PurpleAirLocalAPI\n```\n\nNow we need to make an instance if it.\n\n```python\nmy_paa = PurpleAirLocalAPI([\"ipv4_address\"])\n```\n\nNow we can use that instance to do things like...\n```python\nretval = my_paa.request_local_sensor_data()\n```\n\n## Tests\n\nRefer to the test [readme](/tests/README.md)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "",
"version": "1.1.4",
"project_urls": {
"Homepage": "https://github.com/carlkidcrypto/purpleair_api"
},
"split_keywords": [
"purpleair_api",
"purple air api",
"purple_air",
"purple air",
"purpleair_sensor",
"purpleair sensor",
"purpleair-sensor"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d6ce29f35e513b0e980d112938bbf1c5cbf4bd05badf1df32fe0afb14615c928",
"md5": "5fa806faf5a6b124f6ce93a9678e0b7b",
"sha256": "c7c182e2fb6dcf1c4da57bd9c0a6a792ec9ae88e3dd3dd2e2f7e194d18f49a99"
},
"downloads": -1,
"filename": "purpleair_api-1.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5fa806faf5a6b124f6ce93a9678e0b7b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 15052,
"upload_time": "2024-02-22T04:00:29",
"upload_time_iso_8601": "2024-02-22T04:00:29.434774Z",
"url": "https://files.pythonhosted.org/packages/d6/ce/29f35e513b0e980d112938bbf1c5cbf4bd05badf1df32fe0afb14615c928/purpleair_api-1.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d0706e4ddbb8c519a58c48468b6d8787c5fcc47943df40318634d78a80c6ef86",
"md5": "aec600b2fb2675acd7033eb0f445218e",
"sha256": "c50be8249d6c21f67cc12aec31c4a47fdcb5ce2cb6becf735f8adaa1d78cf5a9"
},
"downloads": -1,
"filename": "purpleair_api-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "aec600b2fb2675acd7033eb0f445218e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16537,
"upload_time": "2024-02-22T04:00:31",
"upload_time_iso_8601": "2024-02-22T04:00:31.038313Z",
"url": "https://files.pythonhosted.org/packages/d0/70/6e4ddbb8c519a58c48468b6d8787c5fcc47943df40318634d78a80c6ef86/purpleair_api-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 04:00:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "carlkidcrypto",
"github_project": "purpleair_api",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "purpleair-api"
}