Catman...EPHSEQ(3pm)

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

πŸ’– 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 an IO::Handle. if you don't specify it, Catmandu::Util::io is used to create the input stream from the file argument, or by using STDIN. so if you're feeling lazy, STDIN is right there waiting for you. πŸ™ˆ
  • encoding β€” binmode of the input stream fh. it's set to ":utf8" by default, so it's already giving correct-encoding main character energy. πŸ’œ
  • fix β€” an ARRAY of 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::Importer
  • Catmandu::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