LJ Hooker templates re-downloaded so Tracy didn't have to send a ticket to the blackhole of Jira. Updated some scripts to get Sandata groups and a few Walmart screenshots.

This commit is contained in:
Norm Rasmussen
2024-04-10 17:37:51 -04:00
parent 9ddc3f7b1e
commit 958f1ec991
107 changed files with 2280 additions and 146 deletions

View File

@ -23,3 +23,4 @@ DOUGLASELLIMAN = "Bknf8kidbluRfcKu3m3lKoxS8"
CIN7 = "51BNlRsLYKQxSu1q1UQq7F63j"
FULLSTORY = "ePChrDWLegENa2qnfb259O2Ki"
RENAISSANCE = "YFykqX1u0d3HveONc5I9CKnJ1"
SANDATA = "HdZFoXGCFpt8NnTOzIQY0kVDj"

View File

@ -5,7 +5,7 @@ import Apikeys
import json
APIKEY = Apikeys.ANTHOLOGY
APIKEY = Apikeys.SANDATA
groups_dict = {}
pp = pprint.PrettyPrinter(indent=4)
@ -35,7 +35,7 @@ def get_groups(APIKEY):
break
with open(
"/Users/normrasmussen/Downloads/Datasnipper-Groups.csv", "a+", newline="\n"
"/Users/normrasmussen/Downloads/Sandata-Groups.csv", "a+", newline="\n"
) as csvfile:
for group in groups:
for key, value in group.items():

View File

@ -1,10 +1,20 @@
import requests
import pandas as pd
import Apikeys
import pprint
apiKey = Apikeys.walmartprod
pp = pprint.PrettyPrinter(indent=4)
apiKey = Apikeys.WALMARTPROD
course_dict = {}
COURSES= [
"Shopping an order",
"Delivery FAQs",
"Checking out Shopping & Delivery orders",
"Shopping & Delivery FAQs",
"Communicating with customers",
"Delivering an order",
]
def get_course():
count = 0
@ -13,7 +23,6 @@ def get_course():
while True:
count += 1
url = f"https://api2.northpass.com/v2/courses?page={count}"
print(url)
headers = {"accept": "application/json", "X-Api-Key": apiKey}
response = requests.get(url, headers=headers)
data = response.json()
@ -24,23 +33,28 @@ def get_course():
uuid = response["id"]
name = response["attributes"]["name"]
# build_url = response["links"]["builder"]["href"]
course_dict = {
"id": uuid,
"name": name,
"status": status,
# "build_url": build_url
# "url": f"https://walmart.northpass.com/app/courses/{uuid}",
}
if name in COURSES:
print(uuid)
course_dict = {
"id": uuid,
"name": name,
"status": status,
# "build_url": build_url
# "url": f"https://walmart.northpass.com/app/courses/{uuid}",
}
courses.append(course_dict)
# FIX: Up until here, each course gets read to the terminal.
# FIX: After this, something is being overwritten.
cat_id = response["relationships"]["categories"]["data"]
get_cat_name(cat_id, course_dict, courses)
# cat_id = response["relationships"]["categories"]["data"]
# get_cat_name(cat_id, course_dict, courses)
if "next" not in nextlink:
break
# pp.pprint(courses)
# print(len(courses))
def get_cat_name(cat_id, course_dict, courses):
headers = {"accept": "application/json", "X-Api-Key": apiKey}