A Ruby library to parse, create and manage MARC records http://marc.rubyforge.org/
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2011-12-24 12:27:35 +01:00
bin consolidated some xml testing, and added marc2xml command line tool 2006-01-21 21:36:19 +00:00
examples added examples dir 2007-11-13 14:23:02 +00:00
lib Typo in the codes method (dedupe should be dedup) - thanks to Amy Unger for pointing this out 2011-10-13 11:08:22 -04:00
test added test for unicode 2011-06-01 11:19:48 -04:00
Changes Updated Rakefile for new gem and changes as well as some documentation cleanup. 2009-09-24 02:09:08 +00:00
LICENSE changed the license and ready for release 2007-11-12 14:37:07 +00:00
marc.gemspec Defined marc.gemspec, extracted version and spec info to separate file 2011-12-24 12:20:10 +01:00
Rakefile Defined marc.gemspec, extracted version and spec info to separate file 2011-12-24 12:20:10 +01:00
README Added bundler installation description to README 2011-12-24 12:27:35 +01:00
version.rb Defined marc.gemspec, extracted version and spec info to separate file 2011-12-24 12:20:10 +01:00

marc is a ruby library for reading and writing MAchine Readable Cataloging
(MARC). More information about MARC can be found at <http://www.loc.gov/marc>.

USAGE 

  require 'marc'

  # reading records from a batch file
  reader = MARC::Reader.new('marc.dat')
  for record in reader
    # print out field 245 subfield a
    puts record['245']['a']
  end

  # creating a record 
  record = MARC::Record.new()
  record.append(MARC::DataField.new('100', '0',  ' ', ['a', 'John Doe']))

  # writing a record
  writer = MARC::Writer.new('marc.dat')
  writer.write(record)
  writer.close()

  # writing a record as XML
  writer = MARC::XMLWriter.new('marc.xml')
  writer.write(record)
  writer.close()
  
  # encoding a record
  MARC::Writer.encode(record) # or record.to_marc

INSTALLATION

If you are looking at this file you may want to be able to install the code. 
First you'll need to test:

  rake test

then build the gem:

  rake package

and install the versioned gem:

  gem install pkg/marc-x.x.x.gem 

INSTALLATION USING BUNDLER
  
add to your Gemfile:

  gem 'marc', :git => 'https://github.com/ruby-marc/ruby-marc.git'

and run
 
  bundle

AUTHORS

Kevin Clarke <ksclarke@gmail.com>
Bill Dueber <bill@dueber.com>
William Groppe <will.groppe@gmail.com>
Ross Singer <rossfsinger@gmail.com>
Ed Summers <ehs@pobox.com>

Please send bugs, requests and comments to Code4Lib Mailing list (https://listserv.nd.edu/cgi-bin/wa?A0=CODE4LIB).