Skip to main content

elizur.

License: GPL v3 CI PyPI version codecov Ruff

Elizur is an open source finance package for actuaries, finance professionals, and students. The package currently helps with calculating annuity present values, annuity future values, cash flow expected present values, and life contingencies. Elizur depends on NumPy and Polars at runtime. The project is named after Elizur Wright.

If you like Elizur, support the project by clicking the ⭐ above!

Requirements

Install

pip install elizur

Documentation

Read the library documentation here

Examples

All calculations accept a single numeric type or iterable (including numpy arrays) as input

Given an interest rate calculate a discount factor

>>> import elizur.life.annuity as ann
>>> ann.discount_factor(0.07)
0.9345794
>>> ann.discount_factor([0.07, 0.06])
array([0.93457944, 0.94339623])

Given a term and interest rate calculate the present value of an annuity

>>> 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])

Given a term and interest rate calculate the present value of an annuity increasing by one each period

>>> import elizur.life.annuity as ann
>>> ann.increasing_annuity_pv(n=10, i=0.07)
34.73913324929581
>>> ann.increasing_annuity_pv(n=[10, 20], i=[0.07, 0.08])
array([34.73913325, 78.90793815])

Given cash flows, probabilities, and interest rates calculate the expected present value

>>> 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
>>> expected_present_value(
...     cash_flows=(
...         (10, 11, 12),
...         (13, 14, 15)
...     ),
...     probabilities=(
...         (0.99, 0.98, 0.97),
...         (0.96, 0.95, 0.94)
...     ),
...     interest_rates=(
...         (0.05, 0.06, 0.07),
...         (0.08, 0.09, 0.10)
...     )
... )
array([28.88814436, 33.74225435])

Given a mortality table calculate life contingencies and probabilities

>>> from elizur.life.table import LifeTable, EXAMPLE_TABLE
>>> life_table = LifeTable(EXAMPLE_TABLE)
>>> life_table.qx(0)
0.006271
>>> life_table.qx(77)
0.036094
>>> life_table.tqxn(3, 2, 77)
0.08770141840040623
>>> life_table.Ax(0, 0.07)
0.01562517028789102
>>> life_table.IAxn(0, 0.07, 30)
0.04871771529491165
>>> life_table.ax(0, 0.07)
14.046872397027947
>>> life_table.axn_due(0, 0.07, 30)
13.173054007415931

Import a mortality table in a specific SOA CSV format and perform life contingency calculations. Download a mortality table in csv format from the SOA here. This example uses the first table, 1941 CSO Basic Table ANB.

>>> from elizur.life.util import read_soa_csv_mort_table
>>> from elizur.life.table import LifeTable
>>> mort_table = read_soa_csv_table("1941_cso_basic_table_anb.csv")
>>> life_table = LifeTable(mort_table["values"])
>>> life_table.qx(77)
0.10364
>>> life_table.Ax(0, 0.07)
0.03800673925889163

There are many other possibilities. Check out the reference section of the docs for a full list of functionality.

Contributing

Checkout the contributing guide here if you'd like to contribute code or raise issues here.

Metadata

Release files for elizur 0.3.1

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

Source distribution (sdist)

Source distribution for elizur 0.3.1
File Size Uploaded
elizur-0.3.1.tar.gz 11.5 kB Details

Built distribution (wheel)

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

Total release size: 26.9 kB

Release files / elizur-0.3.1.tar.gz

Download URL elizur-0.3.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cf4beae5cd0269bfeb483d2b94ceb99d9326177f16768935aa190ff5d5a16c27
BLAKE2b-256 checksum
How to use checksums
77c88ffd32a2934c88eb526c499fe2c7011760806335bde275512704ab8ff9ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Release files / elizur-0.3.1-py3-none-any.whl

Download URL elizur-0.3.1-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ad6e29801a0520b980d8174a4b9b55ec395e0bf885419ea2f906350a7edda6d
BLAKE2b-256 checksum
How to use checksums
18ac442e29c61b1c4ed75f799c4f3fbde6a1de07087f383693eebd972c1b8ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

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