Cin7 notes, BigIdeas notes and just updated a script for cin7.

This commit is contained in:
Norm Rasmussen
2024-02-26 17:03:16 -05:00
parent ec4ca6e94b
commit 995feecb65
5 changed files with 27 additions and 7 deletions

View File

@ -3,11 +3,11 @@ import os
import Apikeys
import requests
apikey = Apikeys.WALMARTPROD
apikey = Apikeys.CIN7
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,
@ -18,12 +18,12 @@ response = response.json()
for item in response['data']:
id = item['id']
name = item['attributes']['name']
with open('/Users/normrasmussen/Downloads/Spark_Categories.csv', 'a', newline='') as csvfile:
with open('/Users/normrasmussen/Downloads/Cin7.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/Spark_Categories.csv', 'r') as readfile:
with open('/Users/normrasmussen/Downloads/Cin7.csv', 'r') as readfile:
reader = csv.reader(readfile)
for row in reader:
print(row)