Biblio...::Utils(3pm)

πŸ“¦
version 1.10 Β· 2 versions
  • 1.10 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.10 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Biblio::Citation::Parser::Utils β€” bestie edition πŸ’–

okay so real talk, this is the page for Biblio::Citation::Parser::Utils from the User Contributed Perl Documentation, and it's a 3pm manual, which is just fancy speak for "perl module docs". it lives in the Biblio...::Utils(3pm) slot in the manual lineup. and honestly? it's giving library science but make it cute. let's get into it πŸ¦‹


✨ NAME ✨

Biblio::Citation::Parser::Utils β€” OpenURL utility functions πŸŽ€

like. it's the lil helper toolbox for OpenURL stuff. that's the whole vibe.


🌸 DESCRIPTION 🌸

so this module is where the reference-metadata-to-OpenURL pipeline lives. it's got all the methods you need to take reference metadata and parse it into OpenURLs πŸ’…

the tea though: they tried to make it 1.0 compliant, and like, they really did try, but there might still be errors in there. please let us know if there are! πŸ™ˆ bestie they're literally asking. don't be shy.


πŸ‘‘ METHODS πŸ‘‘

🧼 $openurl_hash = Biblio::Citation::Parser::Utils::trim_openurl($openurl)

you hand it a hash of metadata, it hands you back a hash containing only the valid OpenURL fields. that's it. it's the Marie Kondo of hashes β€” does this field spark OpenURL validity? no? then it's not staying. ✨


🧚 $openurl_hash = Biblio::Citation::Parser::Utils::decompose_openurl($openurl)

okay this one is the main character fr fr. it's here to enrich an OpenURL metadata hash by throwing a whole bunch of parsing techniques at the fields. specifically:

  • it decomposes dates into years, months, and days β€” if possible (no promises, it's doing its best 😭)
  • it fills in the appropriate fields if SICIs are present
  • it makes sure URLs, ISBNs, etc, are valid

and what do you get back? a pointer to a hash with the modified metadata, plus an array of errors (if any). so like, the receipts AND the drama. 🫢


πŸ”— $openurl = Biblio::Citation::Parser::create_openurl($metadata)

this one creates and returns an OpenURL from a metadata hash. slay. BUT β€” and this is important β€” no base URLs are prepended to this, so you gotta do that yourself before you go using it as a link. don't skip that step bestie, it's not optional.

also, heads up: URI::OpenURL should be used to generate OpenURLs in place of this function. so this one's more of a legacy icon than a go-to. iconic, but retired energy πŸ’€

πŸ“š $valid_isbn = Biblio::Citation::Parser::Utils::isbn_check(@isbn_chars)

simple lil function, no notes. you give it an array of ISBN characters, it returns true if it's a valid ISBN. that's the whole thing. clean, straightforward, we love her. πŸ’œ


πŸ—‚οΈ $sici_hash = Biblio::Citation::Parser::Utils::parse_sici($sici)

feed it a SICI string, and it returns a hash of information parsed out of it β€” including date information, issn numbers, etc. so much goodness extracted from one lil string, honestly obsessed. 🌈


🚧 $bici_hash = Biblio::Citation::Parser::Utils::parse_bici($bici)

not yet implemented!! 😭

so like, this is the placeholder. eventually it's gonna be the BICI alternative for parse_sici, but right now? it's a vibe and a dream. do not come for her, she's not ready. πŸ™ˆ


🌐 $escaped_url = ParaTools::Utils::url_escape($string)

simple function to convert a string into an encoded URL (so like, spaces become %20, etc). takes the unencoded URL as a parameter, and returns the encoded version. tiny, useful, does exactly what it says on the tin. ⭐

(note: yes, this one's namespaced under ParaTools::Utils, not Biblio::... β€” that's just how it is, don't @ me. πŸ’…)


πŸ’Œ AUTHOR πŸ’Œ

Mike Jewell <moj@ecs.soton.ac.uk> β€” thank you for your service king 🫑


and that's the whole page bestie!! this one's from perl v5.36.0, dated 2022-11-19, filed under Biblio...::Utils(3pm). go parse some references, stay valid, and remember: if you find a bug, tell them, they literally asked. bye pookie πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ