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.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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: is a standalone python module that you can drop into your 
project as needed or you can install globally with:

  python 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: --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: --processes 4 --contact-name 'Ed Summers' mydir

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


  % git clone git://
  % cd bagit 
  % python

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 

  % ./


  * 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


Ed Summers <>


Public Domain <>
You can’t perform that action at this time.