Tons of Solutions Engineering work done today for the rest of the CS team! Headway, Howard Hanna, Engels, Brighton, etc. Also completed Datasnippers auth flow and worked on Anthology's script. Cloned Anthology's courses (900..) and will clone Full Story on Monday.

This commit is contained in:
Norm Rasmussen
2024-01-05 17:07:59 -05:00
parent ce261975ca
commit a5fe4bd2c8
3157 changed files with 554269 additions and 16 deletions

View File

@ -1,9 +1,10 @@
import pprint
import csv
import json
import requests
import Apikeys
APIKEY = Apikeys.ANTHOLOGY
APIKEY = Apikeys.DATASNIPPER
groups_dict = {}
pp = pprint.PrettyPrinter(indent=4)
@ -26,18 +27,19 @@ def get_groups(APIKEY):
group_id = response["id"]
group_name = response["attributes"]["name"]
# print(group_name)
groups_dict = {
group_name : group_id
}
groups_dict = {group_name: group_id}
groups.append(groups_dict)
if "next" not in nextlink:
break
pp.pprint(groups)
print(len(groups))
# with open('/Users/normrasmussen/Documents/Work/CustomerNotes/Anthology/antho-groups.json', 'w') as jsn:
# json.dump(groups, jsn)
with open(
"/Users/normrasmussen/Downloads/Datasnipper-Groups.csv", "a+", newline='\n'
) as csvfile:
for group in groups:
for key, value in group.items():
csvwriter = csv.writer(csvfile)
csvwriter.writerow([key, value])
if __name__ == "__main__":