Catman...EPHSEQ(3pm)
π Catmandu::Importer::MARC::ALEPHSEQ π
okay bestie, gather round, because this one is niche and iconic. this is Catmandu::Importer::MARC::ALEPHSEQ from the 3pm manual pages β a whole package that imports Ex Libris' Aleph sequential MARC records. yes, THAT Aleph. the library-system one. we're doing library data today and honestly? slay. π¦
β¨ NAME β¨
Catmandu::Importer::MARC::ALEPHSEQ β the package that imports Ex Libris' Aleph sequential MARC records. that's the whole vibe. no cap. π
πΈ SYNOPSIS πΈ
so here's how you actually use it, two ways, pick your fighter:
# From the command line
$ catmandu convert MARC --type ALEPHSEQ --fix "marc_map('245a','title')" < /foo/usm01.txt
# From perl
use Catmandu;
# import records from file
my $importer = Catmandu->importer('MARC',file => '/foo/usm01.txt' , type => 'ALEPHSEQ');
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};
});
the way that first line just pipes /foo/usm01.txt straight into catmandu convert MARC --type ALEPHSEQ and maps 245a onto titleβ¦ chef's kiss. π and then the perl version either walks the importer with each, or wraps the whole thing in the fixer and prints the title with printf. both valid. both cute. π
π§ CONFIGURATION π§
these are the knobs you can turn when you build the importer. respect them, they're doing their best:
fileβ read input from a local file given by its path. alternatively, a scalar reference can be passed to read from a string. so like, a file path OR a string ref, your choice, no judgment. β¨fhβ read input from anIO::Handle. if you don't specify it,Catmandu::Util::iois used to create the input stream from thefileargument, or by usingSTDIN. so if you're feeling lazy, STDIN is right there waiting for you. πencodingβ binmode of the input streamfh. it's set to":utf8"by default, so it's already giving correct-encoding main character energy. πfixβ anARRAYof one or more fixes or file scripts to be applied to imported items. stack those fixes, bestie. π
π METHODS π
every Catmandu::Importer is a Catmandu::Iterable, so all its methods are inherited. that's it. that's the section. free methods, no extra charge, we love inheritance in this house. π
π SEE ALSO π
go read these next, they're the friends of the family:
Catmandu::ImporterCatmandu::Iterable
perl v5.38.2 πΈ 2024-08-03 π β and that's the whole page, bestie! mwah, go import some Aleph sequential MARC records, you've got this. πβ¨
π¦ where this page comes from
- debian trixie: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms