Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby Library and Command Line tools for BagIt
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib version up to 0.3.2
spec Revert "test for adding a data file manually and remanifesting"
.rvmrc add rvm, travis config, and change version to pre
.travis.yml only build master on travis-ci
Gemfile First stab at reformatting this gem a bit.
LICENSE.txt usual stuff update readme with better comments for console tools
Rakefile forgot to uncomment this
bagit.gemspec First stab at reformatting this gem a bit.

BagIt (for ruby)

Build Status

Based on the BagItspec v0.97.

Supported Features:

  • bag compiling
  • manifest & tagmanifest generation
  • generation of tag files bag-info.txt and bagit.txt
  • fetching remote files (fetch.txt)
  • bag validation


% gem install bagit validatable

The rubyforge gem is deprecated.

Example: making a bag

require 'bagit'

# make a new bag at base_path
bag = base_path

# make a new file
bag.add_file("samplefile") do |io|
  io.puts "Hello Bag!"

# generate the manifest and tagmanifest files

Example: validating an existing bag

bag = existing_base_path

if bag.valid?
  puts "#{existing_base_path} is valid"
  puts "#{existing_base_path} is not valid"

Console Tool

# create a new bag/add files to existing bag
bagit add -f file1 file2 -t tagfile1 tagfile2 ./path/to/bag 
# validate
bagit validate ./path/to/bag
# for other commands
bagit --help


  • deep directory add/delete for bag and tag files in console tools
  • better holy bag (fetch.txt) generation
  • better error reporting.

Copyright © 2009, Francesco Lazzarino.

Current maintainer: Tom Johnson.

Initial development sponsored by Florida Center for Library Automation.

See LICENSE.txt for terms.

Something went wrong with that request. Please try again.