bagit-python
bagit-python copied to clipboard
Updating Bag Manifests
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!
I solved the problem by changing the workflow, but I'd still be interested to know if this is doable. Thanks.
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
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.
+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.