Catman...::MARC(3pm)

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

✨ NAME ✨

Catmandu::Exporter::MARC β€” the exporter for MARC records, bestie πŸ’–

Ok so real talk, this whole page is Catman...::MARC (that's the Catmandu::Exporter::MARC manual, third-party Perl docs, section 3pm) and it's literally just here to tell you how to write MARC out. Let's go πŸ¦‹


🌸 SYNOPSIS 🌸

Like, here's the vibe, copy-paste ready:

# 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

# Convert on format to another format
$ catmandu convert MARC --type ISO to MARC --type ALEPHSEQ < /foo/bar.mrc > /foo/bar.aleph

Slay. That's it, that's the whole mood ✨


πŸ’… DESCRIPTION πŸ’…

Catmandu::Exporter::MARC is a Catmandu::Exporter β€” which is the fancy way of saying it serializes (aka writes) MARC records out to a file or straight to standard output. No cap. That's its whole job and it does it gorgeously πŸ‘‘


πŸŽ€ CONFIGURATION πŸŽ€

πŸ“ file

Write the output to a local file, given by its path or by a file handle. But wait, there's more β€” you can also pass a scalar reference to write into a string instead, or a code reference to write to a callback function. Choose your own adventure, periodt πŸ’«

πŸ¦‹ fh

Write the output to an IO::Handle. If you don't specify one, Catmandu::Util::io swoops in and builds the output handle for you β€” either from the file argument or by using STDOUT. It's giving helpful πŸ’œ

🌈 fix

An ARRAY of one or more fixes, or file scripts, that get applied to the exported items. Basically your glow-up pass before things ship πŸ’–

πŸ‘‘ type

The MARC format you want to export. Here are the MARC exporters you can pick from:

  • ISO: Catmandu::Exporter::MARC::ISO (default) β€” a strict ISO 2709 exporter
  • ALEPHSEQ: Catmandu::Exporter::MARC::ALEPHSEQ β€” an exporter for Ex Libris Aleph sequential files
  • Line: Catmandu::Exporter::MARC::Line β€” an exporter for Index Data's MARC Line format
  • MARCMaker: Catmandu::Exporter::MARC::MARCMaker β€” an exporter for MARCMaker/MARCBreaker records
  • MiJ: Catmandu::Exporter::MARC::MiJ (MARC in JSON) β€” an export for the MARC-in-JSON format
  • XML: Catmandu::Exporter::MARC::XML β€” an exporter for the MARC XML format

Pick one, any one 🧚

πŸ’€ skip_errors

If you set this, then any errors that pop up while parsing MARC output get skipped and ignored. Lowkey risky, but if you wanna see every single error message, turn on the debug setting of catmandu:

$ catmandu -D convert MARC to MARC --skip_errors 1 --fix myfixes.txt < /foo/bar.mrc
Bestie, it literally says skipped and ignored β€” errors just vanish into the void. The -D debug flag is how you actually get receipts on what went wrong πŸ”₯

🫢 <other>

Every MARC importer can have its own options, fr fr. So go check the documentation of that specific importer for the full tea 😭


⭐ SEE ALSO ⭐

  • Catmandu::Importer::MARC

Ok that's the whole page, you ate it πŸ’… This was the Catman...::MARC page, Perl v5.38.2, dated 2024-08-03 β€” love that for us. Now go export some MARC records, main character πŸŒŸπŸ¦‹πŸ’–

πŸ“¦ where this page comes from