Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibonds-1.0.7.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibonds-1.0.7-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ibonds-1.0.7.tar.gz.

File metadata

  • Download URL: ibonds-1.0.7.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ibonds-1.0.7.tar.gz
Algorithm Hash digest
SHA256 633886b4485bc72268d926c355c9fd4b3a7c08b738bb72a34ab3282ffec39dad
MD5 bef503063cb00baeb795b5b6a0a58d96
BLAKE2b-256 92b8fd308eacfe21d77db59ee40c31dd66433d0341a1e06d60881b00bb74d407

See more details on using hashes here.

File details

Details for the file ibonds-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: ibonds-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ibonds-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 09be47f374b0cc746a1fefd00716285e2f1210fdb768a06fcb74f42c182e676f
MD5 8fc6c12316ac89661e4d0a119aea2823
BLAKE2b-256 162b992ddd40ca855b19e611e9c185644ce0b42c01c63f3528c1a62be31a78ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page