Project

bagit

0.06
Low commit activity in last 3 years
There's a lot of open issues
A long-lived project that still receives updates
Ruby Library and Command Line tools for bagit
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 12.3.3
~> 3

Runtime

~> 0.5.0
 Project Readme

BagIt (for ruby)

Build Status Coverage Status

This is a Ruby library and command line utility for creating BagIt archives based on the BagItspec v0.97.

Supported Features:

  • Bag creation
  • Manifest & tagmanifest generation
  • Generation of tag files bag-info.txt and bagit.txt
  • Fetching remote files (fetch.txt)
  • Bag validation

Installation

# gem install bagit validatable

Example: making a bag

require 'bagit'

# make a new bag at base_path
bag = BagIt::Bag.new base_path

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

# generate the manifest and tagmanifest files
bag.manifest!(algo: 'sha256')

Example: validating an existing bag

bag = BagIt::Bag.new existing_base_path

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

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

Copyright © 2009, Francesco Lazzarino.

Current maintainer: Jamie Little.

Initial development sponsored by Florida Center for Library Automation.

See LICENSE.txt for terms.