Skip to main content

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 from PyPi. To install via pip:

pip install ibonds

Or, via pipx

pipx install ibonds

Or, on Arch Linux, you can install it from AUR via AUR helpers or directly

yay -S python-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.

Metadata

Release files for ibonds 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibonds 1.0.9
File Size Uploaded
ibonds-1.0.9.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ibonds 1.0.9
File Interpreter ABI Platform
ibonds-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / ibonds-1.0.9.tar.gz

Download URL ibonds-1.0.9.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9100dbe0657287d3e282e6de8ed8eee55c4ccdd068d9fb7ce8fe9b6998e3f68b
BLAKE2b-256 checksum
How to use checksums
96708bc04b0de948d1dd6da62fd7ebeb8412ef98d6c7384a4a1cf6575b78d07a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ibonds-1.0.9-py3-none-any.whl

Download URL ibonds-1.0.9-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f06320aaf25129190ccc457f07756040efa69ea9566440a6d1a06c0dc605e82
BLAKE2b-256 checksum
How to use checksums
a240bf371d254b3227908d4ea3fc60802afeb6f779f5289b6263e23ce04bfd4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page