Catman...::Lint(3pm)

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

✨ NAME ✨

okay so bestie, welcome to Catman...::Lint (it lives in the User Contributed Perl Documentation section, 3pm, iykyk) πŸ’–

Catmandu::Importer::MARC::Lint β€” a package that imports USMARC records, except it runs them through MARC::Lint first so you get that validation tea β˜•βœ¨


🌸 SYNOPSIS 🌸

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

# From perl
use Catmandu;

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

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

# or using the fixer

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so every single item that the Catmandu::Importer::MARC::Lint importer hands you comes with three keys, no more no less, periodt πŸ’…

'_id'    : the system identifier of the record (usually the 001 field)
'record' : an ARRAY of ARRAYs containing the record data
'lint'   : the output of MARC::Lint's check_record on the MARC record
  • '_id' β€” the system identifier of the record, which is usually the 001 field πŸ‘‘
  • 'record' β€” an ARRAY of ARRAYs holding the record data, it's giving nested, it's giving structure 🧚
  • 'lint' β€” literally the output of MARC::Lint's check_record run on the MARC record πŸ”₯

πŸŽ€ CONFIGURATION πŸŽ€

  • id β€” the MARC field that holds the system id (default: 001) 🫢
  • file β€” read input from a local file by passing its path. alternatively you can pass a scalar reference and it'll read from a string, flexible much? 😌
  • fh β€” read input from an IO::Handle. if you don't specify one, Catmandu::Util::io gets used to create the input stream from the "file" argument, or from STDIN 🌈
  • encoding β€” binmode of the input stream "fh". it's set to ":utf8" by default, iconic πŸ’œ
  • fix β€” an ARRAY of one or more fixes or file scripts that get applied to the imported items ✨

πŸ‘‘ METHODS πŸ‘‘

every Catmandu::Importer is a Catmandu::Iterable, so all its methods are inherited β€” you get the whole inheritance situation for free, slay πŸŽ‰


πŸ’€ SEE ALSO πŸ’€

  • Catmandu::Importer
  • Catmandu::Iterable

okay that's the whole page bestie, go forth and lint those MARC records πŸ’– this was perl v5.38.2, dated 2024-08-03, and yes it's still filed under Catman...::Lint(3pm) because the vibes are eternal πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from