Registry / data / bond-pricing

bond-pricing

JSON →
library0.7.3pypypiunverified

A library for bond pricing with YTM/zero-curve and NPV, IRR, annuities. Current version 0.7.3 (requires Python >=3.0). Release cadence: irregular.

pip install bond-pricing
INSTALL
IMPORT
SIG · BOND-PRICING
B
bond-pricing
datapythonv0.7.3
Install
11.3s avg
Import
Disk
305MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 306.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 11.3s · import 0.000s · 293MB
305MB installed
● package 305MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Bond
from bond_pricing import Bond
Main class for bond calculations.
zero_curve
from bond_pricing import zero_curve
Function to construct zero-coupon yield curve.
annuity
from bond_pricing import annuity
Annuity present value calculation.
irr
from bond_pricing import irr
Internal rate of return.

Create a bond and compute yield to maturity.

from bond_pricing import Bond bond = Bond(face_value=1000, coupon_rate=0.05, maturity=10, price=950) print(bond.ytm())
Debug
Known issues
gotchaFace value must be provided as a number (int or float) and cannot be a string. Passing a string will raise a TypeError.
fix
Ensure face_value is numeric.
affects: all
deprecatedThe method `price_from_ytm()` is deprecated in 0.7.0 in favor of `price()`.
fix
Use `bond.price(ytm=0.05)` instead of `bond.price_from_ytm(0.05)`.
affects: >=0.7.0
breakingIn version 0.7.0, the `zero_curve` function signature changed: the argument `spot_rates` renamed to `rates`.
fix
Use keyword argument `rates` instead of `spot_rates`.
affects: ==0.7.0, <0.7.0
Upgrade
Version history
0.7.3latest on PyPI · released Sep 25, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
bond-pricing — pip install bond-pricing · libregistry