Catman...AlephX(3pm)

πŸ’– Catman...AlephX(3pm) πŸ’–

okay bestie, buckle up β€” this is Catmandu::Importer::AlephX, aka the package that pulls metadata records straight out of an AlephX service. she's giving ✨library data✨ and honestly? iconic. πŸŽ€


🌸 NAME 🌸

Catmandu::Importer::AlephX β€” the package that imports metadata records from the AlephX service. yes that's literally her whole job and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

use Catmandu::Importer::AlephX;

my $importer = Catmandu::Importer::AlephX->new(
                    url => 'http://ram19:8995/X' ,
                    query => 'WRD=(art)' ,
                    base => 'usm01' ,
                    );

my $n = $importer->each(sub {
    my $r = $_[0];
    # ...
    say Dumper($r->{record});
    say Dumper($r->{items});
});

like. look at her. three lil params and she's cooking πŸ“


πŸ¦‹ METHODS πŸ¦‹

🌟 new(url => '...' , base => '...' , query => '...')

spawn a brand new AlephX importer, bestie. the required params are:

  • the url β€” the base url of the AlephX service
  • an Aleph base β€” the catalog name
  • and a query

no skipping any of those three, okay? πŸ‘‘

πŸ’œ common parameters

  • url β€” base url of the alephx service (e.g. "http://ram19:8995/X")
  • include_items β€” 0|1. when you set it to '1', the items of every bibliographical record are retrieved 🫢

πŸŽ€ alephx parameters

  • base β€” name of catalog in Aleph where you want to search
  • query β€” the query, of course 😌

πŸ’… output

and this is what you get back, bestie β€” it's giving structured data:

 {
   record => [
     [
       'FMT',
       '',
       '',
       '_',
       'MX'
     ],
     [
       'LDR',
       '',
       '',
       '_',
       '01236npca^22001937|^4500'
     ]
     ..
   ],
   items => [
     {
       'sub-library' => 'WID',
       'chronological-k' => '',
       'chronological-i' => '',
       'library' => 'USM50',
       'collection' => 'HD',
       'call-no-1' => '$$2ZHCL$$hH 810.80.20',
       'chronological-j' => '',
       'requested' => 'N',
       'expected' => 'N',
       'barcode' => 'HWM4M4',
       'description' => '',
       'note' => '',
       'item-status' => '01',
       'rec-key' => '000048762000010',
       'enumeration-a' => '',
       'call-no-2' => '',
       'enumeration-b' => '',
       'enumeration-c' => '',
       'on-hold' => 'N'
     }
   ]

 }

⭐ count

⭐ each(&callback)

⭐ ...

every Catmandu::Importer is a Catmandu::Iterable, so all its methods are inherited β€” you get the whole family tree for free, no cap 🧚

⚠️ okay this part matters: the Catmandu::Importer::AlephX methods are not idempotent: Twitter feeds can only be read once. like… read it once and it's gone, bestie. no re-runs. 😭

πŸ‘‘ AUTHOR πŸ‘‘

Patrick Hochstenbach β€” "patrick dot hochstenbach at ugent dot be" πŸ“§


🌈 SEE ALSO 🌈

  • Catmandu::Iterable

and that's the whole page, bestie!! πŸŽ€ this was perl v5.36.0, dated 2023-02-02, and it's part of the User Contributed Perl Documentation β€” mwah, go read some records, you got this πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from