Skip to content
Snippets Groups Projects
Commit cf2b805a authored by Zhao, Qin's avatar Zhao, Qin
Browse files
parents 98a95f64 d22198fa
No related branches found
No related tags found
No related merge requests found
'''
If you know the collection id please write it here as python string.
Also set the metadata according to the descritpion below, as well as the
collection id.
'''
#collection_id = None #pyhton string
collection_id = "9b18efa4-a75b-45bc-b60e-e72633c81862" #pyhton string
#metadata = None #python list of dictionarys
metadata = [
{"key":"dc.contributor.author",
"value":"Mustermann, Max",
"language":None
},
{"key":"dc.title",
"value":"test update metadata per rest",
"language":None
}
]
'''
Collection id can be obtained from the "Sammlung bearbeten" page in the web
interface. If this is left as "None" you will be asked for the collection
name later.
The metadata for item creation should at least contain the dc.title keyword
as shown in the example below. Of course you can add extra metadata entrys
to the list (python list) with different keywords.
(keywords in example folder -> "metadata_keywords.txt")
Example of metadata
metadata = [{"key":"dc.title",
"value":"Example Item Name",
"language":None
}
{"key":"dc.date.issued",
"value":"2019",
"language":None
}
]
'''
'''
Set the metadata according to the descritpion below
'''
#python list of strings
item_id_list = ["087d3827-7b73-437d-970e-acec7b4e9520"]
#python list of list of dictionarys
metadata_list = [
[{"key":"dc.description",
"value":"This item is inserted/updated via REST interface",
"language":None
},
{"key":"dc.type",
"value":"Other",
"language":None
},
{"key":"dc.date.issued",
"value":"2019",
"language":None
}
]
]
'''
Item id can be obtained from the "Edit Item" page in the web
interface.
For each Item you specify you have to specify a list of metadata entrys
for this item.
Each list of metadata entrys must be in the list "metadata_list"
Each metadata entry must be a dictionary.
See examples below.
(keywords in example folder -> "metadata_keywords.txt")
Example entry for the metadata:
{"key":"dc.contributor.author",
"value":"Mustermann, Max",
"language":None
}
Example list of metadata lists:
example_metadata_list = [
[{"key":"dc.contributor.author",
"value":"Mustermann, Max",
"language":None
},
{"key":"dc.type",
"value":"Other",
"language":None
},
{"key":"dc.date.issued",
"value":"2019",
"language":None
}
]
]
'''
'''
For a flawless upload of many files to all the desired items the following
variables have to be set:
upload_list which is a list of 2-element lists
e2 the 2-element list containing 1. the item id and 2. the folder
from which all files will be upload to the item on TUdatalib
Replace <directory_path> with the WHOLE path to the folder you want to
upload files from.
ALL files in this directory will be uploaded.
'''
from pathlib import Path
#upload_list = None #python list of list of strings
upload_list =[
["087d3827-7b73-437d-970e-acec7b4e9520",Path("configs/test")]
]
'''
Please stick to this format (number of elements variable):
Using backslashes \\ in directory path in windows OS
upload_list = [
["<item_id>",Path(<directory_path>)],
["<item_id>",Path(<directory_path>)]
]
'''
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment