pyPreservica Ingests

55 views
Skip to first unread message

Sam Brenton

unread,
Jun 29, 2022, 4:48:55 AM6/29/22
to pyPreservica
Hi James,

It was good to see your demo of pyPreservica at the user group yesterday, it's something I've experimented with but would like to try and incorporate it into our workflow properly

I hope you don't mind, I've got a couple of questions that I didn't have time to ask yesterday,

You showed us how it's possible to ingest assets that have an access file and a preservation file, however we have a lot of material from digitisation were we have two preservation copies, and no access copy

At the moment we ingest this PUT tool with multiple manifestation folders Preservica_preservation1_lnk and Preservica_preservation2_lnk, which creates seperate content objects within the preservation representation

Is it possible to generate this with pyPreservica?

Also, you showed us how to create new folders and put files in to them. Could you send the sample code for that please? I've found the function create_folder in the entityAPI but I can't work out how to get a reference back from that folder to then use it to upload in the same script

Thanks

Sam

Laura Peaurt

unread,
Jul 6, 2022, 4:06:32 AM7/6/22
to pyPreservica
Hi,

Just to second Sam and say that the demonstration was super helpful at the user group. 

It would be fantastic to have a copy of all the scripts you showed us so that I can have a go with scripts that I know should work (just replacing with my own file information obviously) to test things out before deciding how best to incorporate pypreservica into my own workflows - it would be a great way to get started with this tool.

Apologies if I have missed these scripts being shared somewhere else

Many thanks James!

Laura

Sam Brenton

unread,
Jul 6, 2022, 4:11:20 AM7/6/22
to pyPreservica
Hi,

If you haven't looked already, there's some sample code on the pyPreservica readthedocs site ( Welcome to pyPreservica’s documentation — pyPreservica documentation) under the heading for each API, but it doesn't include all the scripts that were demonstrated though

Sam

James Carr

unread,
Jul 6, 2022, 5:22:22 AM7/6/22
to pyPreservica
This link will let you download a copy of the scripts i used at the UG workshop last week.

James Carr

unread,
Jul 6, 2022, 5:39:40 AM7/6/22
to pyPreservica
At the moment we ingest this PUT tool with multiple manifestation folders Preservica_preservation1_lnk and Preservica_preservation2_lnk, which creates seperate content objects within the preservation representation
Is it possible to generate this with pyPreservica?


Yes, although its not documented yet because its slightly more complicated. 

You create the package using:

generic_asset_package(preservation_files_dict=None, access_files_dict=None, export_folder=None, parent_folder=None, compress=True, **kwargs):

Here  preservation_files_dict is  python dict containing any number of preservation representations, the key of the dict is the name of the preservation representation and the value is a list of content objects.

e.g. a book with multiple pages, scanned as JP2 & TIFF as long term preservation and a PDF access copy

preservation_files = {}
access_files = {}

preservation_files["JP2000 Images"] = ["page1.jp2", "page2.jp2", "page3.jp2"]
preservation_files["TIFF Images"] = ["page1.tif", "page2.tif", "page3.tif"]

access_files["PDF version"] = ["book.pdf"]


package = generic_asset_package(preservation_files_dict= preservation_files  , access_files_dict= access_files)


Regarding the create_folder() call, this function returns the new folder as an object.

new_folder = client.create_folder("title", "description", "open") 
print(new_folder.reference)

On Wednesday, 29 June 2022 at 09:48:55 UTC+1 yi2...@bristol.ac.uk wrote:

Laura Peaurt

unread,
Jul 12, 2022, 9:18:18 AM7/12/22
to pyPreservica
Thanks James this is so useful!

Laura
Reply all
Reply to author
Forward
0 new messages