Mizuno monthly script. Some cin7 and datasnipper templates and todo list items.

This commit is contained in:
Norm Rasmussen
2024-03-04 17:08:39 -05:00
parent d5926729ad
commit 34032ab681
10 changed files with 1211 additions and 122 deletions

View File

@ -4,8 +4,8 @@ from pathlib import Path
import Apikeys
import os
basefile = "/Users/normrasmussen/Downloads/ts-mca.csv"
api_key = Apikeys.TALKSPACE_1099
basefile = "/Users/normrasmussen/Downloads/MizunoCompletionsFeb2024.csv"
api_key = Apikeys.MIZUNO
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
prop_url = "https://api.northpass.com/v2/properties/people/"
headers = {
@ -29,17 +29,15 @@ def load_file(basefile):
email = email[3]
url = uuid_url + f"{email}"
response = requests.get(url, headers=headers)
print(response)
if response.status_code == 200:
response = response.json()
uuid = response["data"][0]["id"]
url2 = prop_url + f"{uuid}"
response = requests.get(url2, headers=headers)
data = response.json()
userid = data["data"]["attributes"]["properties"]["user_id"]
userid = data["data"]["attributes"]["properties"]["account_number"]
row_dict["userid"] = userid
dict_list.append(row_dict)
print(dict_list)
print("No errors! Passing along the dictionary!")
except KeyError as e:
print(f"{e} and the rest")
@ -51,9 +49,8 @@ def load_file(basefile):
completions.loc[completions.index[row], "userid"] = pid
completions = completions[completions["userid"] != "0"]
# completions = completions.iloc[:, 0:]
print(completions)
completions.to_csv(
"/Users/normrasmussen/Downloads/Talkspace1099-Completions-All-IDS.csv",
"/Users/normrasmussen/Downloads/Mizuno-Feb2024-with-PGAID.csv",
index=False,
)

View File

@ -1,10 +1,12 @@
import requests
import pandas as pd
from pathlib import Path
import Apikeys
import os
basefile = "/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv"
api_key = "stXNF84HWL8aCGeRjHEo2rJ1U"
basefile = "/Users/normrasmussen/Downloads/MizunoCompletionsFeb2024.csv"
api_key = Apikeys.MIZUNO
# "stXNF84HWL8aCGeRjHEo2rJ1U"
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
group_url = "https://api.northpass.com/v2/groups/"
headers = {
@ -45,7 +47,7 @@ def load_file(basefile):
completions.loc[completions.index[row], "Group Name"] = group
print(completions)
completions.to_csv(
"/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv",
"/Users/normrasmussen/Downloads/MizunoCompletionsFeb2024_with_PGAIDs.csv",
index=False
)