Tons of anthology work with notes and scripts. Updated DE's tamplates. Small script changes as well.

This commit is contained in:
Norm Rasmussen
2023-11-17 17:18:13 -05:00
parent c3aedce0d1
commit 09053c34cd
32 changed files with 22644 additions and 575 deletions

View 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()