Financ...dBonds(3pm)

πŸ“¦ version 1.51, in ubuntu jammy

πŸ’– Finance::Quote::USFedBonds β€” the (3pm) manual page, bestie edition πŸ’–

okay so you want US Federal Bond redemption values? from http://www.treasurydirect.gov? say less. this is the Perl module that does exactly that, and it's lowkey iconic for it. the manual name is Finance::Quote::USFedBonds(3pm) btw, in case the vibe check required receipts. πŸ’…


✨ NAME ✨

Finance::Quote::USFedBonds β€” grab US Federal Bond redemption values straight from http://www.treasurydirect.gov. no cap, that's the whole job. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

the main character usage, fr fr:

use Finance::Quote;

$q    = Finance::Quote->new();
%info = $q->fetch('usfedbonds', 'E197001.200606');

like. two lines. that's it. she's efficient. 😭


🌸 DESCRIPTION 🌸

so basically this gives you access to redemption values for US Federal Bonds from the treasury. treasury. capital T. very official energy. πŸ‘‘

and the way that you gotta identify these bonds is very specific, so listen up because the format is not vibes-based, it's character-count-based:

  • SERIES(1) β€” one single character, and it's one of I / E / N / S
  • ISSUEDATE(6) β€” six characters, in YYYYMM form
  • SEPERATOR(1) β€” one single character, and it's literally just "."
  • REDEMPTIONDATE(6) β€” six characters again, also YYYYMM

so the whole thing is series + issue date + dot + redemption date. for example:

E200101.200501

that's it, that's the whole format. copy the shape exactly or she will simply not know what you're talking about. πŸ™ˆ


🌈 LABELS RETURNED 🌈

when you fetch, these are the keys you get back, and they are:

  • price
  • date
  • isodate

three little icons, all serving. ✨


πŸ¦‹ TERMS & CONDITIONS πŸ¦‹

okay the boring-but-actually-important part, but I'm gonna say it with sparkle because that's just who I am:

use of www.treasurydirect.gov is governed by any terms & conditions of that site. their house, their rules, periodt. 🫑

and Finance::Quote itself is released under the GNU General Public License, version 2, which explicitly carries a "No Warranty" clause. so like. she's free and she's generous, but she is also not promising you anything, and that clause is doing a lot of heavy lifting. read it, bestie. πŸ’€


and that's the page!! this one came out of perl v5.32.1 and it's dated 2021-09-01, so it's a lil vintage but still absolutely eating. πŸ’– mwah, go fetch some bonds. πŸŽ€

πŸ“¦ where this page comes from