Skip to content
create BagIt style packages of digital content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test-data
.gitignore
README
bagit.py
bench.py
setup.py
test.py

README

This package can be used to create BagIt style packages programmatically
in Python or from the command line.  More about BagIt can be found at:

  http://purl.org/net/bagit

bagit.py is a standalone python module that you can drop into your 
project as needed or you can install globally with:

  python setup.py install

From python you can use the bagit module to make a bag like this: 

  import bagit
  bag = bagit.make_bag('mydir', {'Contact-Name': 'Ed Summers'})

Or if you've got an existing bag

  import bagit
  bag = bagit.Bag('/path/to/bag')

Or from the command line:

  bagit.py --contact-name 'Ed Summers' mydir

If you'd like to generate the checksums using parallel system processes, 
instead of single process:

  bagit.make_bag('mydir', {'Contact-Name': 'Ed Summers'}, processes=4) 

or:

  bagit.py --processes 4 --contact-name 'Ed Summers' mydir

bag --help will give the full set of options.

Development

  % git clone git://github.com/edsu/bagit.git
  % cd bagit 
  % python test.py

If you'd like to see how increasingl parallelization of bag creation on 
your system effects the time to create a bag try using the included bench 
utility:

  % ./bench.py

TODO:

  * define the return value of make_bag
  * add validation
  * write manifest to tmp file first before moving stuff around, so that 
    if the manifest generation throws an exception the bag directory
    will be left untouched

Contact

Ed Summers <ehs@pobox.com>

License

Public Domain <http://creativecommons.org/licenses/publicdomain/>
You can’t perform that action at this time.