From b42fcf61412237a08776033e290e745b25f90915 Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sun, 14 Feb 2021 12:19:49 -0500 Subject: [PATCH 1/5] Add DOI for #72 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ccf53dd..917fb23 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # PurpleAir API +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4540629.svg)](https://doi.org/10.5281/zenodo.4540629) + A Python 3.x module to turn data from the PurpleAir/ThingSpeak API into a Pandas DataFrame safely, with many utility methods and clear errors. ![Global Sensor Map with Celsius Scale](maps/sensor_map.png) From 67bf224814528119b1fa9f5658be76bbca90324d Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sun, 14 Feb 2021 12:24:46 -0500 Subject: [PATCH 2/5] Update method signature --- docs/api/channel_methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/channel_methods.md b/docs/api/channel_methods.md index be41992..07dd1c1 100644 --- a/docs/api/channel_methods.md +++ b/docs/api/channel_methods.md @@ -117,7 +117,7 @@ The data is shaped like this: } ``` -## `get_historical(weeks_to_get: int, thingspeak_field: str, start_date: Optional[datetime] = None) -> pd.DataFrame` +## `get_historical(weeks_to_get: int, thingspeak_field: str, start_date: datetime = datetime.now()) -> pd.DataFrame` Get data from the ThingSpeak API from field `thingspeak_field` one week at a time up to `weeks_to_get` weeks in the past. From 3d42cf65632605f2efbff2861d5a663c514e649d Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sun, 14 Mar 2021 09:55:01 -0400 Subject: [PATCH 3/5] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2eddd42..037629a 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='purpleair', - version='1.2.3', + version='1.2.4', description='Python API Client to get and transform PurpleAir data.', long_description=LONG_DESCRIPTION, long_description_content_type="text/markdown", From a2990e3e8cbbf7f76ce260b078144bf8ffa32726 Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sun, 14 Mar 2021 09:55:17 -0400 Subject: [PATCH 4/5] Update field names for #78 --- purpleair/api_data.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/purpleair/api_data.py b/purpleair/api_data.py index f3404bd..bef0c20 100644 --- a/purpleair/api_data.py +++ b/purpleair/api_data.py @@ -20,14 +20,14 @@ PARENT_PRIMARY_COLS = { 'created_at': 'created_at', 'entry_id': 'entry_id', - 'field1': 'PM1.0_CF_ATM_ug/m3', - 'field2': 'PM2.5_CF_ATM_ug/m3', - 'field3': 'PM10.0_CF_ATM_ug/m3', + 'field1': 'PM1.0 (CF=1) ug/m3', + 'field2': 'PM2.5 (CF=1) ug/m3', + 'field3': 'PM10.0 (CF=1) ug/m3', 'field4': 'UptimeMinutes', 'field5': 'ADC', 'field6': 'Temperature_F', 'field7': 'Humidity_%', - 'field8': 'PM2.5_CF_1_ug/m3', + 'field8': 'PM2.5 (CF=ATM) ug/m3', } PARENT_SECONDARY_COLS = { @@ -39,21 +39,21 @@ 'field4': '2.5um/dl', 'field5': '5.0um/dl', 'field6': '10.0um/dl', - 'field7': 'PM1.0_CF_1_ug/m3', - 'field8': 'PM10.0_CF_1_ug/m3', + 'field7': 'PM1.0 (CF=ATM) ug/m3', + 'field8': 'PM10 (CF=ATM) ug/m3', } CHILD_PRIMARY_COLS = { 'created_at': 'created_at', 'entry_id': 'entry_id', - 'field1': 'PM1.0_CF_ATM_ug/m3', - 'field2': 'PM2.5_CF_ATM_ug/m3', - 'field3': 'PM10.0_CF_ATM_ug/m3', + 'field1': 'PM1.0 (CF=1) ug/m3', + 'field2': 'PM2.5 (CF=1) ug/m3', + 'field3': 'PM10.0 (CF=1) ug/m3', 'field4': 'UptimeMinutes', 'field5': 'RSSI_dbm', - 'field6': 'Pressure_hpa', - 'field7': 'Blank', - 'field8': 'PM2.5_CF_1_ug/m3', + 'field6': 'Atmospheric Pressure', + 'field7': 'gas_sensor', + 'field8': 'PM2.5 (CF=ATM) ug/m3', } CHILD_SECONDARY_COLS = { @@ -65,6 +65,6 @@ 'field4': '2.5um/dl', 'field5': '5.0um/dl', 'field6': '10.0um/dl', - 'field7': 'PM1.0_CF_1_ug/m3', - 'field8': 'PM10.0_CF_1_ug/m3' + 'field7': 'PM1.0 (CF=ATM) ug/m3', + 'field8': 'PM10 (CF=ATM) ug/m3' } From ebc4f40fd87f2e06c618c4ef95f19dcd9216c521 Mon Sep 17 00:00:00 2001 From: Christopher Sardegna Date: Sun, 14 Mar 2021 10:10:31 -0400 Subject: [PATCH 5/5] Update docs for #78 --- README.md | 2 +- docs/api/channel_methods.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 917fb23..5ddb63d 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ print(df.head()) Result: ```log - created_at PM1.0_CF_ATM_ug/m3 PM2.5_CF_ATM_ug/m3 PM10.0_CF_ATM_ug/m3 UptimeMinutes RSSI_dbm Pressure_hpa Blank PM2.5_CF_1_ug/m3 + created_at PM1.0 (CF=1) ug/m3 PM2.5 (CF=1) ug/m3 PM10.0 (CF=1) ug/m3 UptimeMinutes RSSI_dbm Pressure_hpa Blank PM2.5 (CF=ATM) ug/m3 entry_id 1002561 2020-09-09 00:01:09+00:00 1.03 1.41 1.41 18136.0 0.01 982.25 NaN 1.41 1002562 2020-09-09 00:03:09+00:00 1.07 1.60 1.60 18136.0 0.01 982.18 NaN 1.60 diff --git a/docs/api/channel_methods.md b/docs/api/channel_methods.md index 07dd1c1..fc4cf65 100644 --- a/docs/api/channel_methods.md +++ b/docs/api/channel_methods.md @@ -131,11 +131,11 @@ Parent Primary: * Timestamp of data posting to ThingSpeak (created by ThingSpeak) * `entry_id` * row number relative to all data Parent primary data (created by ThingSpeak) -* `PM1.0_CF_ATM_ug/m3` +* `PM1.0 (CF=1) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~1.0um for “atmospheric” particles (From Plantower 5003/1003) -* `PM2.5_CF_ATM_ug/m3` +* `PM2.5 (CF=1) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~2.5um for “atmospheric” particles (From Plantower 5003/1003) -* `PM10.0_CF_ATM_ug/m3` +* `PM10.0 (CF=1) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~10um for “atmospheric” particles (From Plantower 5003/1003) * `UptimeMinutes` * the amount time the unit CPU has been running since it was powered up (From ESP8266 WiFi chip) @@ -145,7 +145,7 @@ Parent Primary: * Temperature inside of the sensor housing in Fahrenheit. On average, this is 8F higher than ambient conditions. (From BME280) * `Humidity_%` * Relative humidity inside of the sensor housing as a percentage. On average, this is 4% lower than ambient conditions (From BME280) -* `PM2.5_CF_1_ug/m3` +* `PM2.5 (CF=ATM) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~2.5um for “standard” particles (From Plantower 5003/1003) Parent Secondary: @@ -177,11 +177,11 @@ Child Primary: * Timestamp of data posting to ThingSpeak (created by ThingSpeak) * `entry_id` * row number relative to all data child primary data (created by ThingSpeak) -* `PM1.0_CF_ATM_ug/m3` +* `PM1.0 (CF=1) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~1.0um for “atmospheric” particles (From Plantower 5003/1003) -* `PM2.5_CF_ATM_ug/m3` +* `PM2.5 (CF=1) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~2.5um for “atmospheric” particles (From Plantower 5003/1003) -* `PM10.0_CF_ATM_ug/m3` +* `PM10.0 (CF=1) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~10um for “atmospheric” particles (From Plantower 5003/1003) * `UptimeMinutes` * the amount time the unit CPU has been running since it was powered up @@ -192,7 +192,7 @@ Child Primary: * `Blank` * No Data * Note: there appears to be some float data in this column -* `PM2.5_CF_1_ug/m3` +* `PM2.5 (CF=ATM) ug/m3` * mass concentration calculated from count data for particle sizes ~0.3um to ~2.5um for “standard” particles (From Plantower 5003/1003) Child Secondary: