Catman...RC::RAW(3pm)

πŸ“¦
version 1.320 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so bestie, gather round πŸ’– this one is Catmandu::Importer::MARC::RAW β€” the 3pm manual page β€” and it's literally the package that imports ISO 2709 encoded MARC records. that's the whole vibe. RAW MARC in, records out, no drama πŸŽ€


🌸 SYNOPSIS 🌸

you can run it from the command line like this:

# From the command line
$ catmandu convert MARC --type RAW --fix "marc_map('245a','title')" < /foo/bar.mrc

or if you're a perl girlie (respect πŸ’…):

# From perl
use Catmandu;

# import records from file
my $importer = Catmandu->importer('MARC',file => '/foo/bar.mrc' , type => 'RAW');
my $fixer    = Catmandu->fixer("marc_map('245a','title')");

$importer->each(sub {
    my $item = shift;
    ...
});

and like, you can also chain it through the fixer if that's your thing:

# or using the fixer

$fixer->fix($importer)->each(sub {
    my $item = shift;
    printf "title: %s\n" , $item->{title};
});

no cap, that second one is giving main character energy πŸ‘‘


πŸ¦‹ CONFIGURATION πŸ¦‹

every single knob you can turn, coming right up:

  • id β€” the MARC field that holds the system id. default is 001. that's it, that's the one 🫢
  • file β€” read your input from a local file, you just hand it the path. OR you can pass a scalar reference and it'll read from a string instead. cute, right? ✨
  • fh β€” read input from an IO::Handle. if you don't specify it, Catmandu::Util::io gets called in to build the input stream from the file argument, or from STDIN. either way, it's handled πŸ’…
  • encoding β€” the binmode of the input stream fh. it's set to :utf8 by default. iconic default behaviour, honestly 🌈
  • fix β€” an ARRAY of one or more fixes, or file scripts, that get applied to your imported items. load it up bestie πŸ”₯

πŸ’œ METHODS πŸ’œ

every Catmandu::Importer is a Catmandu::Iterable, so all its methods are inherited. that means you get the whole inheritance situation for free β€” no extra work, just vibes 🧚


⭐ SEE ALSO ⭐

go peek at these too, they're the supporting cast:

  • Catmandu::Importer
  • Catmandu::Iterable

and that's the page, bestie πŸŽ€ this was Catmandu::Importer::MARC::RAW, perl v5.38.2, dated 2024-08-03 β€” slay, go import some records, ily πŸ’–

πŸ“¦ where this page comes from