All that Walmart work and they can't even launch tomorrow.... finished up the work for the Basic/3P user groups. Was then told these learners need to be able to buy courses, which isn't possible with their current configuration. Backing up the files to git anyway, just in case.

This commit is contained in:
Norm Rasmussen
2025-03-04 16:30:56 -05:00
parent f7492809ac
commit 0242384887
20 changed files with 2378 additions and 90 deletions

View File

@ -1,9 +1,9 @@
import pprint
import requests
import Apikeys
import pandas as pd
# import pandas as pd
APIKEY = Apikeys.SPS
APIKEY = Apikeys.ANTHOLOGY
URL = "https://api.northpass.com/v1/media"
pp = pprint.PrettyPrinter(indent=4)
@ -19,9 +19,10 @@ def getMedia(APIKEY, URL):
response = requests.get(URL, headers=headers)
datas = response.json()
nextlink = datas["links"]
# pp.pprint(datas)
pp.pprint(datas)
for data in datas["data"]:
print(data)
file_type = data["attributes"]["file_type"]
file_name = data["attributes"]["file_name"]
created_date = data["attributes"]["created_at"]
@ -44,11 +45,11 @@ def getMedia(APIKEY, URL):
# print(len(list_data))
toCsv(list_data)
def toCsv(json):
js = pd.DataFrame.from_records(json)
# js = pd.json_normalize(json, "data", ["data"])
# csv = pd.Series(js)
js.to_csv("/Users/normrasmussen/Downloads/sps-media-lib.csv")
# def toCsv(json):
# js = pd.DataFrame.from_records(json)
# # js = pd.json_normalize(json, "data", ["data"])
# # csv = pd.Series(js)
# js.to_csv("/Users/normrasmussen/Downloads/sps-media-lib.csv")
if __name__ == "__main__":