Catman...::Z3950(3pm)

πŸ’– Catmandu::Importer::Z3950 β€” the manual page, bestie edition ✨

okay so welcome to Catmandu...::Z3950(3pm), aka the perl manpage you're reading at 2am because the library catalogue isn't gonna query itself 🫢


🌸 NAME 🌸

Catmandu::Importer::Z3950 β€” the package that imports Z3950 data. that's it. that's the whole job. it pulls Z3950 records into your Catmandu world and it does it flawlessly πŸ’…


✨ SYNOPSIS ✨

lowkey the fastest way to get it: straight from the command line, no code, no stress πŸŽ€

# On the command line

$ catmandu convert Z3950 --host z3950.loc.gov --port 7090 --databaseName Voyager --query "(title = dinosaur)"

and if you're a perl girlie and you wanna do it ~properly~, here's the whole vibe from inside your script 🌈

# From Perl

use Catmandu;

my $importer = Catmandu->importer('Z3950'
        host => 'z3950.loc.gov',
        port => 7090,
        databaseName => "Voyager",
        preferredRecordSyntax => "USMARC",
        queryType => 'PQF', # CQL or PQF
        query => '@attr 1=4 dinosaur'
);

my $n = $importer->each(sub {
  my $hashref = $_[0];
  ...
});

see that each? every record comes through as a $hashref and you get to do whatever your heart desires with it. main character energy fr fr πŸ‘‘


πŸŽ€ CONFIGURAION πŸŽ€

(yes bestie the typo is literally canon, i don't make the rules πŸ’€)

these are all the lil knobs you can turn. every single one, no skips:

  • host β€” the Z3950 host name. where your data lives, basically its home address 🏠
  • port β€” the Z3950 port. the specific door you're knocking on πŸšͺ
  • user β€” a user name. gotta introduce yourself ✨
  • password β€” a password. the secret handshake, keep it cute, keep it secret πŸ™ˆ
  • databaseName β€” the database to connect to. which one are we raiding today πŸ’…
  • preferredRecordSyntax β€” the preferred response format (default: USMARC). if you don't say anything it just goes with USMARC, iconic behaviour 🌸
  • queryType β€” the queryType (CQL or PQF). pick your language πŸ¦‹
  • query β€” the query. the actual thing you're asking for, the moment of truth πŸ”₯
  • handler β€” the Perl handler that parses the response content. examples are 'USMARC' and 'UNIMARC' πŸ‘‘

and here's a full real example where basically every option shows up to the party, including the --handler:

$ catmandu convert Z3950 \
         --user 'XXX' \
         --password 'XXX' \
         --host z3950.bnf.fr \
         --port 2211 \
         --databaseName TOUT-ANA1-UTF8 \
         --preferredRecordSyntax Unimarc \
         --queryType PQF \
         --query '@attr 1=7 9782744024191' \
         --handler UNIMARC

like??? she's doing the absolute most and i'm obsessed 😭✨


πŸ’œ REQUIREMENTS πŸ’œ

this package uses the ZOOM package internally. for more info visit:

http://search.cpan.org/~mirk/Net-Z3950-ZOOM-1.28/lib/ZOOM.pod

and heads up β€” the ZOOM package has a hard dependency on the YAZ toolkit. not a soft lil suggestion, a hard one. for more info about YAZ, visit:

https://www.indexdata.com/yaz

installing YAZ:

  • (osx, using homebrew): brew install yaz
  • (linux, using yum): yum install yaz libyaz

πŸ‘‘ AUTHOR πŸ‘‘

  • Wouter Willaert, <wouterw@inuits.eu>
  • Patrick Hochstenbach, <patrick.hochstenbach@ugent.be>

πŸ¦‹ CONTRIBUTORS πŸ¦‹

  • Emmanuel Di Pretoro, edipretoro at gmail.com

🌈 SEE ALSO 🌈

  • Catmandu::Iterable

and that's the whole page bestie, you're officially certified in Z3950 importing πŸŽ“βœ¨ this absolute gem of a manpage comes from perl v5.36.0 and was dated 2023-02-04 β€” go forth and query, and remember: the vibe check is USMARC by default πŸ’…πŸ’–

πŸ“¦ where this page comes from