Catman...::MARC(3pm)
π NAME π
okay so bestie, <pink>Catmandu::Importer::MARC</pink> is literally the package that imports MARC data. that's it, that's the vibe. β¨
this page lives in the Catman...::MARC(3pm) man page, section 3pm, and we're gonna get through it together. grab a strawberry π and let's go.
πΈ SYNOPSIS πΈ
fr fr, here's how you actually use it. all of this is copy-paste-able, no cap:
# On the command line
# Convert MARC to JSON (default)
$ catmandu convert MARC < /foo/bar.mrc
# Convert MARC to MARC
$ catmandu convert MARC to MARC < /foo/bar.mrc > /foo/output.mrc
# Add fixes
$ catmandu convert MARC to MARC --fix myfixes.txt < /foo/bar.mrc > /foo/output.mrc
# Create a list of titles
$ catmandu convert MARC to TSV --fix "marc_map(245,title); retain(title)" < /foo/bar.mrc
# Convert MARC XML
$ catmandu convert MARC --type XML < /foo/bar.xml
# Convert ALEPH sequential
$ catmandu convert MARC --type ALEPHSEQ < /foo/bar.aleph
# Convert on format to another format
$ catmandu convert MARC --type ISO to MARC --type ALEPHSEQ < /foo/bar.mrc > /foo/bar.aleph
likeβ¦ converting formats back and forth?? that's giving main character energy π
π¦ DESCRIPTION π¦
so <purple>Catmandu::Importer::MARC</purple> is a Catmandu::Importer whose whole job is pulling MARC records in from an external source. and every single record it imports? it comes out as a HASH with exactly two keys. iconic behavior honestly.
"_id"β this is the system identifier of the record, which is usually the 001 field π"record"β an ARRAY of ARRAYs holding the actual record data
π EXAMPLE ITEM π
look at this lil guy. this is what a record looks like:
{
record => [
[
'001',
undef,
undef,
'_',
'fol05882032 '
],
[
'245',
'1',
'0',
'a',
'Cross-platform Perl /',
'c',
'Eric F. Johnson.'
],
],
_id' => 'fol05882032'
}
okay yes the _id' has a lil stray quote in there, that's literally how it's written, don't @ me, I'm not touching it π
π METHODS π
this module inherits all the methods of <lavender>Catmandu::Importer</lavender>, and by extension, all of <lavender>Catmandu::Iterable</lavender>. so like, it's got the whole family tree backing it up. π«Ά
β¨ CONFIGURATION β¨
here's where you get to customize your experience, bestie:
fileβ read input from a local file by giving its path. orrr you can pass a scalar reference instead and read straight from a string. versatile queen πfhβ read input from anIO::Handle. and if you don't specify it? thenCatmandu::Util::iois used to build the input stream from the"file"argument, or by using STDIN. iykyk.fixβ an ARRAY of one or more fixes or file scripts that get applied to the imported items. this is your glow-up station πtypeβ the MARC format to parse. here are all the MARC parsers available:
ISO: L<Catmandu::Importer::MARC::ISO> (default) - a strict ISO 2709 parser
RAW: L<Catmandu::Importer::MARC::RAW> - a loose ISO 2709 parser that skips faulty records
ALEPHSEQ: L<Catmandu::Importer::MARC::ALEPHSEQ> - a parser for Ex Libris Aleph sequential files
Line: L<Catmandu::Importer::MARC::Line> - a parser for Index Data's MARC Line format
Lint: L<Catmandu::Importer::MARC::Lint> - a MARC syntax checker
MicroLIF: L<Catmandu::Importer::MARC::MicroLIF> - a parser for the MicroLIF format
MARCMaker: L<Catmandu::Importer::MARC::MARCMaker> - a parser for MARCMaker/MARCBreaker records
MiJ: L<Catmandu::Importer::MARC::MiJ> (MARC in JSON) - a parser for the MARC-in-JSON format
XML: L<Catmandu::Importer::MARC::XML> - a parser for the MARC XML format
like, nine whole parsers?? pick your fighter π₯
skip_errorsβ if you set this, then any errors that pop up while parsing MARC input get skipped and ignored entirely. wanna see all those error messages though? use the debug setting of catmandu:
$ catmandu -D convert MARC --skip_errors 1 < /foo/bar.mrc
<other>β every MARC importer can have its own options, so go check the documentation of the specific importer you're using. don't assume, bestie, read the docs π
π SEE ALSO π
Catmandu::Exporter::MARCβ the other half of the equation, go say hi
ok that's the whole page!! every flag, every parser, every default, all accounted for. nothing skipped, nothing invented. periodt. π
and that's a wrap, bestie! this page came to you from perl v5.38.2, dated 2024-08-03, and it's filed under Catman...::MARC(3pm) in the User Contributed Perl Documentation. now go import some MARC records, you absolute legend ππ
π¦ 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