File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,10 @@ def findKey(d, key):
3636endpoint = '/repositories/3/resources?all_ids=true'
3737
3838ids = requests .get (baseURL + endpoint , headers = headers ).json ()
39+ print len (ids )
3940
4041f = csv .writer (open ('archivalObjectCountByResource.csv' , 'wb' ))
41- f .writerow (['title' ]+ ['uri' ]+ ['id_0' ]+ ['id_1' ]+ ['id_2' ]+ ['id_3' ]+ ['aoCount' ])
42+ f .writerow (['title' ]+ ['bib' ] + [ ' uri' ]+ ['id_0' ]+ ['id_1' ]+ ['id_2' ]+ ['id_3' ]+ ['aoCount' ])
4243
4344records = []
4445for id in ids :
@@ -48,6 +49,10 @@ def findKey(d, key):
4849 title = output ['title' ].encode ('utf-8' )
4950 uri = output ['uri' ]
5051 id0 = output ['id_0' ]
52+ try :
53+ bib = output ['user_defined' ]['real_1' ]
54+ except :
55+ bib = ''
5156 try :
5257 id1 = output ['id_1' ]
5358 except :
@@ -70,7 +75,7 @@ def findKey(d, key):
7075 if 'archival_objects' in value :
7176 archivalObjects .append (value )
7277 aoCount = len (archivalObjects )
73- f .writerow ([title ]+ [uri ]+ [id0 ]+ [id1 ]+ [id2 ]+ [id3 ]+ [aoCount ])
78+ f .writerow ([title ]+ [bib ] + [ uri ]+ [id0 ]+ [id1 ]+ [id2 ]+ [id3 ]+ [aoCount ])
7479
7580elapsedTime = time .time () - startTime
7681m , s = divmod (elapsedTime , 60 )
You can’t perform that action at this time.
0 commit comments