Catman...:AlephX(3pm)
β¨ NAME β¨
Catmandu::Store::AlephX β it's a Catmandu AlephX service, bestie, and it's implemented as a Catmandu::Store. That's the whole vibe. It's from the User Contributed Perl Documentation collection, and the page itself is the one and only Catman...:AlephX(3pm). π
πΈ SYNOPSIS πΈ
okay so this is how you actually use it, no cap:
use Catmandu::Store::AlephX;
my $store = Catmandu::Store::AlephX->new(url => 'http://aleph.ugent.be/X' , username => 'XXX' , password => 'XXX');
$store->bag('usm01')->each(sub {
});
Like, you spin up the store with a url, a username, and a password (the 'XXX's are placeholders, do not come for me), grab yourself a bag, and each your way through every record in it. π¦
π METHODS π
π get($id)
Pulls a record out of the Aleph database. It needs a record identifier, periodt. When it finds the thing you asked for it hands you back a Catmandu MARC record, and on failure it gives you undef. So likeβ¦ vibe check your return value, fr fr. π
π add($catmandu_marc)
Adds or updates a record in the Aleph database. It requires a Catmandu type MARC record, and that record needs a _id field holding the Aleph record number. Heads up: this method will throw an error when an add can't be executed. It's giving dramatic but honestly valid. π
example
π¨ WARNING (the original says it, I'm just screaming it louder): Aleph will ignore the 001 field.
#add new record. WARNING: Aleph will ignore the 001 field,
my $new_record = eval {
$bag->add({
record => [
[
'FMT',
'',
'',
'_',
'SE'
],
[
'LDR',
'',
'',
'_',
'00000cas^^2200385^a^4500'
],
[
'001',
'',
'',
'_',
'000000444'
],
[
'005',
'',
'',
'_',
'20140212095615.0'
]
..
]
});
};
if ($@) {
die "add failed $@";
}
say "new record:".$record->{_id};
So you eval the add, you check $@, you die with "add failed $@"; if it all went sideways, and if it slayed you get to say your brand new $record->{_id}. π
π delete($id)
Deletes a record from the Aleph database. Needs a record identifier, and returns a true value when the record is deleted. Gone. Poof. β¨
π each(callback)
Loops over all the records in the Aleph database, executing your callback for every single one of them. Every. Single. One. π
π search(query => $query, start => 0 , limit => 20);
That's the line, bestie. It's right there. π
π searcher()
Not implemented. π
π delete_all()
Not implemented. π
π delete_by_query()
Not implemented. π
π«Ά SEE ALSO π«Ά
Catmandu::Storeβ go read that one too, iykyk.
and that's the whole page, bestie β sending you off with the receipts: this was Catman...:AlephX(3pm), a User Contributed Perl Documentation page, running on perl v5.36.0, and dated 2023-02-02. ily, go write some Perl. ππΈβ¨
π¦ where this page comes from
- debian bookworm: libcatmandu-alephx-perl 1.073-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatmandu-alephx-perl 1.073-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatmandu-alephx-perl 1.073-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatmandu-alephx-perl 1.073-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-alephx-perl 1.073-2 Β· 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