You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
330 B
Python
15 lines
330 B
Python
9 months ago
|
import json
|
||
|
|
||
|
with open("index.json") as fin:
|
||
|
data = json.load(fin)
|
||
|
|
||
|
projects, shows = 0, 0
|
||
|
|
||
|
for item in data["@graph"]:
|
||
|
if item['type'] == "project":
|
||
|
projects += 1
|
||
|
elif item['type'] == "gradshow":
|
||
|
shows +=1
|
||
|
else:
|
||
|
raise Exception("unknown type")
|
||
|
print (f"{shows} shows, {projects} projects")
|