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:
BIN
Scripts/API_Tests/__pycache__/Apikeys.cpython-313.pyc
Normal file
BIN
Scripts/API_Tests/__pycache__/Apikeys.cpython-313.pyc
Normal file
Binary file not shown.
@ -4,7 +4,7 @@ from pathlib import Path
|
||||
import Apikeys
|
||||
import os
|
||||
|
||||
basefile = "/Users/normrasmussen/Downloads/mizuno-lp-jan25.csv"
|
||||
basefile = "/Users/normrasmussen/Downloads/mizuno-lp-feb25.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/"
|
||||
@ -51,7 +51,7 @@ def load_file(basefile):
|
||||
completions = completions[completions["userid"] != "0"]
|
||||
# completions = completions.iloc[:, 0:]
|
||||
completions.to_csv(
|
||||
"/Users/normrasmussen/Downloads/Mizuno-LP-Jan25-with-PGAID.csv",
|
||||
"/Users/normrasmussen/Downloads/Mizuno-LP-Feb25-with-PGAID.csv",
|
||||
index=False,
|
||||
)
|
||||
|
||||
|
||||
@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user