forked from archivesspace-labs/ArchivesSnake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testScript.py
61 lines (40 loc) · 1.32 KB
/
testScript.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from asnake.aspace import ASpace
AS = ASpace()
repo = AS.repositories(2)
print (repo.resources(150).title)
"""
for collection in repo.resources:
print (collection.title)
# I think we should add these in somehow, maybe namespaced
print (repo.resourceID("apap101").title)
record = AS.archival_object("610555991d1ab7559c835ab7cac38bcf")
#seems a hair slower than I'd expect, but I think it might just be me/my setup
print (repo.archival_objects(210664).title)
#for obj in repo.archival_objects:
#print (obj.title)
record = repo.archival_objects(25720)
for note in record.notes:
if note.type == "scopecontent":
print (note.json())
for accession in repo.accessions:
print (accession.title)
if "2007" in accession.accession_date:
print (accession.json())
for person in AS.agents.people:
print (person.title)
AS.agents.people(115).pp()
for note in repo.resources("150").notes:
if note.type == "abstract":
note.pp()
#print (note) #AWESOME that this returns the actual ASpace model name
#object might not be recursive
#for text in note.content:
#print (text)
#doesn't work, I think we can do it better than I had it anyway
for ao in repo.resources(151).archival_objects:
print (ao.title)
for note in ao.notes:
note.pp()
for spot in AS.locations:
print (spot.building + " " + spot.floor + " " + spot.area)
"""