bagit-python icon indicating copy to clipboard operation
bagit-python copied to clipboard

Updating Bag Manifests

Open ntallman opened this issue 8 years ago • 4 comments

Is it possible to use bagit-python from the command line to update bag manifests? Or is that only possible through a python script? My workflow involved adding additional information to bag-info.txt after bagging which causes a checksum mismatch with the tag manifest. I'd like to be able to re-generate the manifests after this step. Thanks!

ntallman avatar Mar 31 '16 21:03 ntallman

I solved the problem by changing the workflow, but I'd still be interested to know if this is doable. Thanks.

ntallman avatar Mar 31 '16 21:03 ntallman

It does not currently have this ability in the command line. However, the save method in the library does update the tag manifests. see https://github.com/LibraryOfCongress/bagit-python/blob/master/bagit.py#L263-L319

johnscancella avatar May 18 '16 17:05 johnscancella

One useful case for this: upgrading bags to add stronger manifests – ideally we could avoid reading the files more than once by doing something like calculating all of the hashes at the same time, verifying the existing ones, and saving the new ones.

acdha avatar May 09 '17 15:05 acdha

+1 to add the option to do an in-place update e.g. update manifests and bag-info.txt after some files have changed in existing bagit structure.

At least a warning should be printed if bagit.py is invoked on a folder already containing bagit.txt - of course a BagIt can contain a BagIt but it might not be what they meant.

stain avatar Oct 29 '20 12:10 stain