Started the reorganization of Scripts for github. Some notes changes.
This commit is contained in:
@ -4,8 +4,8 @@ from pathlib import Path
|
||||
import Apikeys
|
||||
import os
|
||||
|
||||
basefile = "/Users/normrasmussen/Downloads/mizuno-monthly-completions.csv"
|
||||
api_key = Apikeys.mizuno
|
||||
basefile = "/Users/normrasmussen/Downloads/Recast-learners.csv"
|
||||
api_key = Apikeys.recast
|
||||
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
|
||||
prop_url = "https://api.northpass.com/v2/properties/people/"
|
||||
headers = {
|
||||
@ -30,16 +30,12 @@ def load_file(basefile):
|
||||
response = requests.get(url, headers=headers)
|
||||
if response.status_code == 200:
|
||||
response = response.json()
|
||||
print(response)
|
||||
uuid = response["data"][0]["id"]
|
||||
print(uuid)
|
||||
url2 = prop_url + f"{uuid}"
|
||||
response = requests.get(url2, headers=headers)
|
||||
data = response.json()
|
||||
pgaid = data["data"]["attributes"]["properties"]["account_number"]
|
||||
row_dict["pgaid"] = pgaid
|
||||
elif response.status_code == 404:
|
||||
row_dict["pgaid"] = "User Not Found"
|
||||
dict_list.append(row_dict)
|
||||
print("No errors! Passing along the dictionary!")
|
||||
except KeyError as e:
|
||||
|
||||
Reference in New Issue
Block a user