Skip to content
A set of convenience methods (a la Ruby Facets) on top of ruby-marc to more easily parse the actual data inside the MARC record.
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.
lib
pkg
spec
test
.editorconfig
.gitignore
.rspec
.travis.yml
Changes
Gemfile
LICENSE
README.md
Rakefile
VERSION
enhanced_marc.gemspec

README.md

Enhanced MARC is a set of classes, modules and methods that sit on top of ruby-marc (https://github.com/ruby-marc/ruby-marc) to help parse the contents of MARC records more easily and conveniently.

Build Status

Installation: sudo gem install enhanced_marc

Usage:

  require 'enhanced_marc'

  reader = MARC::Reader.new('marc.dat')

  records = []

  reader.each do | record |
    records << record
  end

Note: enhanced-marc only works directly with MARC::Reader. If you want to use it with MARCXML or MARC-JSON, etc. you'll need to do something like:

  reader.each do | record |
    records << record.to_typed_record
  end

for the same effect

  >> records[0].class
  => MARC::BookRecord

  >> records[0].is_conference?
  => false

  >> records[0].is_manuscript?
  => false

  # Send a boolean true if you want human readable forms, rather than MARC codes.
  >> records[0].literary_form(true)
  => "Non-fiction"

  >> records[0].nature_of_contents(true)
  => ["Bibliography", "Catalog"]

  >> records[1].class
  => MARC::SoundRecord

  >> records[1].composition_form(true)
  => "Jazz"

  >> records[2].class
  => MARC::MapRecord

  >> records[2].projection(true)
  => ["Cylindrical", "Mercator"]

  >> records[2].relief(true)
  => ["Color"]
You can’t perform that action at this time.