Library to calculate the current value of a Series I Savings bond (I Bond)
Project description
I Bonds
This is a python library that calculates the current value of a Series I Savings Bond. The historic rates are supplied via a data file which is updated every time a new rate is released by Treasury Direct.
Installation
This project can be installed via pip. To install the library, run:
pip install ibonds
Example code
from ibonds import IBond
ibond = IBond('01/2010', 10_000) # $10,000 I-Bond bought in Jan 2010
print(f'Fixed Rate: {ibond.fixed_rate()}')
print(f'Current Composie Rate: {ibond.composite_rate()}')
print(f'Current value: {ibond.value()}')
from datetime import date # For historic rates and values.
d = date(2020, 1, 1) # Jan 1, 2020
print(f'Composie Rate on Jan 1, 2020: {ibond.composite_rate(d)}')
print(f'Value on Jan 1, 2020: {ibond.value(d)}')
If you are interested in tracking more than one I Bond, and would prefer a command line interface, please check out lakshmi. If you like a spreadsheet instead, eyebonds.info is a great resource.
Acknowledgements
I would like to acknowledge eyebonds.info and Bogleheads websites which I used to understand I Bond interest rate calculations.
Disclaimer
This library has no link to official Treasury Direct website. No claim is made for any accuracy of data that you generate using this code. Although I have tried my best to implement the formula presented in Tresury Direct, the values returned by this module might be incorrect. When in doubt, go to the official Treasury Direct website to verify any and all information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ibonds-1.0.8.tar.gz.
File metadata
- Download URL: ibonds-1.0.8.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcbd432fd73a74d1fe418170a72cdfc4b84d6e24b45315d0804cd4ffab251b5e
|
|
| MD5 |
7678cbd58d6b1a40448338e74dfcc4ab
|
|
| BLAKE2b-256 |
bc7080045e69f9eb9cae0741f09b7b0a22e90a8b2bf2f52dea1fe7e7c04eecfd
|
File details
Details for the file ibonds-1.0.8-py3-none-any.whl.
File metadata
- Download URL: ibonds-1.0.8-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8ebc0049f45c7f08e76fabdc39426c6ac64f9f78511ea4156db554816bd7024
|
|
| MD5 |
8ea27f87fa5ca1a5477fd3281f6a8292
|
|
| BLAKE2b-256 |
b5313f83324a6389998c618531b0924530e4c8b60cf13e4eb3cebde75a87ba3a
|