Elizur, an Open Source Finance Package
I released Elizur, an open source Python package for actuaries, finance professionals, and students. It is named in honor of Elizur Wright, a 19th century mathematician known as the father of life insurance.
The package helps with calculating annuity present and future values and cash flow expected present values. It accepts both single values and NumPy arrays for vectorized operations and only requires NumPy at runtime.
import elizur.life.annuity as ann
ann.annuity_pv(n=10, i=0.07)
# 7.023581540932602
ann.annuity_pv(n=[10, 20], i=[0.07, 0.08])
# array([7.02358154, 9.81814741])
from elizur.life import expected_present_value
expected_present_value(
cash_flows=(10, 11, 12),
probabilities=(0.99, 0.98, 0.97),
interest_rates=(0.05, 0.06, 0.07)
)
# 28.88814436019514
Install it with pip install elizur. The source and documentation are on GitHub.