Catman...RC::MiJ(3pm)
π Catmandu::Importer::MARC::MiJ π
okay bestie, so Catmandu::Importer::MARC::MiJ is this whole package whose entire job is importing MARC-in-JSON records π
like that's it, that's the gig, and it does it beautifully.
β¨ NAME β¨
Catmandu::Importer::MARC::MiJ β the Package that imports MARC-in-JSON records π no cap.
πΈ SYNOPSIS πΈ
here's the vibe, straight up, no edits:
# From the command line
$ catmandu convert MARC --type MiJ --fix "marc_map('245a','title')" < /foo/bar.json
# From perl
use Catmandu;
# import records from file
my $importer = Catmandu->importer('MARC',file => '/foo/bar.json', type => 'MiJ');
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};
});
like literally just point it at a file and let it cook π₯
π¦ METHODS π¦
new(file => $file , fh => $fh , id => $field)β parses a file or a filehandle into aCatmandu::Iterable, periodt. and if u want, u can also hand it anidattribute that says where the system identifier (_id) field should come from β like'001'for example π
π INHERTED METHODS π
π count
π each(&callback)
π ...
so basically every Catmandu::Importer is a Catmandu::Iterable, which means all of its methods are inherited. you get the whole family tree for free, bestie, it's giving generational wealth πΈ
π§ SEE ALSO π§
MARC::File::MARCMaker
not me ending this with the official receipts but here we are, gotta cite ur sources π
perl v5.38.2 Β· 2024-08-03 Β· and yes the manual name on both ends is Catman...RC::MiJ(3pm) π«Ά slay, go import some MARC-in-JSON, i believe in u πβ¨
π¦ 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