From e259b87bf6e7746d598a126f1c9680d422bcdd09 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Mon, 26 Jun 2023 19:05:11 -0400 Subject: [PATCH] Changes? --- Scripts/API_Tests/add_learnerprop.py | 22 ++++++++++--------- Scripts/GoogleScripts/Harri_Get_Props/test.py | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 Scripts/GoogleScripts/Harri_Get_Props/test.py diff --git a/Scripts/API_Tests/add_learnerprop.py b/Scripts/API_Tests/add_learnerprop.py index c20705f0..b131152d 100644 --- a/Scripts/API_Tests/add_learnerprop.py +++ b/Scripts/API_Tests/add_learnerprop.py @@ -38,7 +38,7 @@ def getfromEmail(emails, baseUrlemail, apiKey, data): print("Another Error!") data["uuid"] = data["email"].map(email_ids) - data.dropna(how='any', inplace=True) + data.dropna(how="any", inplace=True) assignProps(data, apiKey) errorstoCsv(errors) @@ -46,9 +46,9 @@ def getfromEmail(emails, baseUrlemail, apiKey, data): def errorstoCsv(errors): errorcsv = pd.DataFrame(errors) errorcsv.to_csv( - path_or_buf="/Users/normrasmussen/Downloads/Emails_Not_Northpass.csv", - index=False - ) + path_or_buf="/Users/normrasmussen/Downloads/Emails_Not_Northpass.csv", + index=False, + ) def assignProps(data, apiKey): @@ -59,14 +59,16 @@ def assignProps(data, apiKey): uuid = row[4] url = "https://api.northpass.com/v2/properties/people/bulk" payload = { - "data": [{ + "data": [ + { "type": "person_properties", - "attributes": {"properties": { - "user_id": ts_id, - "role_type": ts_role - }}, + "attributes": { + "properties": {"user_id": ts_id, "role_type": ts_role} + }, "id": uuid, - }]} + } + ] + } headers = { "accept": "application/json", "content-type": "application/json", diff --git a/Scripts/GoogleScripts/Harri_Get_Props/test.py b/Scripts/GoogleScripts/Harri_Get_Props/test.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Scripts/GoogleScripts/Harri_Get_Props/test.py @@ -0,0 +1 @@ +