Tons of anthology work with notes and scripts. Updated DE's tamplates. Small script changes as well.
This commit is contained in:
@ -19,3 +19,4 @@ DATASNIPPER = "098Odf9CIkk4aQA1lW7tsa9k8"
|
||||
CHUBB = "m6ZEBesXzpWx2vmp11rEHxrMY"
|
||||
BIRCHSTREET = "WpMV3jF4q9Om5FjUsrzZifduE"
|
||||
G2 = "JRDpCGQ7vSRiva6t5OkWDr5eJ"
|
||||
DOUGLASELLIMAN = "Bknf8kidbluRfcKu3m3lKoxS8"
|
||||
|
||||
Binary file not shown.
@ -36,10 +36,10 @@ def get_groups(APIKEY):
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
|
||||
pp.pprint(groups)
|
||||
# print(len(groups))
|
||||
with open('/Users/normrasmussen/Documents/Work/CustomerNotes/Anthology/antho-groups.json', 'w') as jsn:
|
||||
json.dump(groups, jsn)
|
||||
pp.pprint(groups)
|
||||
print(len(groups))
|
||||
# with open('/Users/normrasmussen/Documents/Work/CustomerNotes/Anthology/antho-groups.json', 'w') as jsn:
|
||||
# json.dump(groups, jsn)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -3,11 +3,11 @@ import os
|
||||
import Apikeys
|
||||
import requests
|
||||
|
||||
apikey = Apikeys.walmartprod
|
||||
apikey = Apikeys.DOUGLASELLIMAN
|
||||
cmd = "touch ~/Downloads/Spark_Categories.csv"
|
||||
|
||||
os.system(cmd)
|
||||
url = "https://api2.northpass.com/v2/categories?limit=100"
|
||||
url = "https://api.northpass.com/v2/categories?limit=100"
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key" : apikey,
|
||||
|
||||
34
Scripts/API_Tests/get_course_ids.py
Normal file
34
Scripts/API_Tests/get_course_ids.py
Normal file
@ -0,0 +1,34 @@
|
||||
import Apikeys
|
||||
import requests
|
||||
|
||||
APIKEY = Apikeys.ANTHOLOGY
|
||||
HEADERS = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key": APIKEY,
|
||||
}
|
||||
|
||||
def get_courses():
|
||||
"""
|
||||
Function to get courses and their IDs
|
||||
"""
|
||||
count = 0
|
||||
list_of_ids = []
|
||||
|
||||
while True:
|
||||
count += 1
|
||||
url = f"https://api.northpass.com/v2/courses/?limit=100&page={count}"
|
||||
response = requests.get(url, headers=HEADERS)
|
||||
response = response.json()
|
||||
nextlink = response["links"]
|
||||
|
||||
for item in response["data"]:
|
||||
id = item["id"]
|
||||
name = item["attributes"]["name"]
|
||||
list_of_ids.append(id)
|
||||
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
print(list_of_ids)
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_courses()
|
||||
Reference in New Issue
Block a user