LibraryOfCongress / bagit-python

Work with BagIt packages from Python.
http://libraryofcongress.github.io/bagit-python
218 stars 85 forks source link

Allow for separate completeness check #87

Closed nkrabben closed 7 years ago

nkrabben commented 7 years ago

Right now bagit.py allows for Oxum validation or Oxum/completeness/hash validation. I have frequent use cases where I just need to check the completeness of a bag.

Currently I'm running a local fork of bagit-python that separates the completeness checking portion of the script and exposes it as its own option. There is a problem with how to expose that option since bagit.py --validate --complete gives a false impression of what the validation process is doing.

However, besides that problem, addressing this issue only requires separating Bag._validate_entries into two separate methods, updating the logic in Bag._validate_contents, and passing the appropriate argument flag.

acdha commented 7 years ago

I've been slowly refactoring the codebase anyway and this would be a good incremental improvement to make the CLI more useful

acdha commented 7 years ago

If you want to send a pull-request, feel free – I'm working on a 1.6 release now but would like to speed up 1.7 so it's not too far behind.