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.
Release files for ibonds 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ibonds-1.0.8.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ibonds-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / ibonds-1.0.8.tar.gz
| Download URL | ibonds-1.0.8.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dcbd432fd73a74d1fe418170a72cdfc4b84d6e24b45315d0804cd4ffab251b5e
|
|
BLAKE2b-256 checksum How to use checksums |
bc7080045e69f9eb9cae0741f09b7b0a22e90a8b2bf2f52dea1fe7e7c04eecfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / ibonds-1.0.8-py3-none-any.whl
| Download URL | ibonds-1.0.8-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8ebc0049f45c7f08e76fabdc39426c6ac64f9f78511ea4156db554816bd7024
|
|
BLAKE2b-256 checksum How to use checksums |
b5313f83324a6389998c618531b0924530e4c8b60cf13e4eb3cebde75a87ba3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|