LibraryOfCongress / bagit-python

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

WIP: Beginning of an S3 experiment #117

Open rstorey opened 5 years ago

acdha commented 5 years ago

As a general comment, I'm not a fan of having large if: blocks since they make it easier to miss bugs or inconsistent behaviour. The approach I've had in mind is basically to create a storage class which would support file enumeration, creation, etc. with a default local filesystem implementation and an optional S3 implementation so we could unit-test just that class and have a single code path through the main file.

This would also work nicely with optional dependencies: pip install bagit would get the traditional bagit.py but pip install bagit[s3] would pull in boto3 as well.