Artera and Blacklane notes. Added some todos. Had to pull category IDs for Walmart.

This commit is contained in:
Norm Rasmussen
2024-03-13 16:31:57 -04:00
parent b11f58a2b7
commit f4a1a757c4
6 changed files with 47 additions and 48 deletions

View File

@ -3,11 +3,11 @@ import os
import Apikeys
import requests
apikey = Apikeys.CIN7
apikey = Apikeys.WALMARTPROD
cmd = "touch ~/Downloads/Spark_Categories.csv"
os.system(cmd)
url = "https://api.northpass.com/v2/categories?limit=100"
url = "https://api2.northpass.com/v2/categories?limit=100"
headers = {
"accept": "application/json",
"X-Api-Key" : apikey,
@ -18,12 +18,12 @@ response = response.json()
for item in response['data']:
id = item['id']
name = item['attributes']['name']
with open('/Users/normrasmussen/Downloads/Cin7.csv', 'a', newline='') as csvfile:
with open('/Users/normrasmussen/Downloads/Spark_Categories.csv', 'a', newline='') as csvfile:
writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
writer.writerow([name, id,])
# print(f"Category: {name} and ID: {id}")
with open('/Users/normrasmussen/Downloads/Cin7.csv', 'r') as readfile:
with open('/Users/normrasmussen/Downloads/Spark_Categories.csv', 'r') as readfile:
reader = csv.reader(readfile)
for row in reader:
print(row)

View File

@ -21,7 +21,7 @@ def getMedia(APIKEY, URL):
file_name = data["attributes"]["file_name"]
created_date = data["attributes"]["created_at"]
id_val = data["id"]
if "2024-03" in created_date:
if "2024-03-12" in created_date:
if "scorm" in file_type:
data_tuple = (id_val, created_date, file_name)
scorm_ids.append(id_val)