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

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

πŸ’– 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 a Catmandu::Iterable, periodt. and if u want, u can also hand it an id attribute 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