callable-bond-analytics
Zero-network fixed-income analytics for callable and perpetual AT1 bonds powered by QuantLib:
- Schedule & XIRR primitives (
callable_bond_analytics.schedule): ACT/ACT ICMA coupon schedules, accrued interest, bisection ACT/365xirr, standaloneytc, and DV01/MV-weightedportfolio_yield_summary. - QuantLib callable & perpetual pricing (
callable_bond_analytics.quantlib_pricing):calculate: ACT/ACT ICMA cashflows with unadjusted accrual periods andFollowingpayment dates, off-cycle call-date accrued stubs, annual 30/360 Bond Basis comparison YTC, street YTC, Modified Duration, DV01 per 100, +200 bp dirty price shock, and repricing residual check.ytp_from_reset: perpetual AT1 Yield-to-Perpetuity (YTP) and Yield-to-Worst (YTW) with exact mid-period coupon reset stub splitting.fixed_usd_ytm: conventional 30/360 semiannual street YTM with German T+2 settlement.
- Spread interpolation (
callable_bond_analytics.spreads):interpolate_par_swap/add_spread: provider-agnostic par IRS I-spread interpolation with business-day pillar adjustment, curve-lag disclosure, and strict no-extrapolation guards.treasury_g_spread: linear Treasury par-yield G-spread interpolation without extrapolation.
Installation
pip install callable-bond-analytics
Quick Start
from datetime import date
from callable_bond_analytics import calculate, ytp_from_reset, treasury_g_spread
terms = {
"coupon": 0.065,
"frequency": 2,
"pay_anchors": [(5, 15), (11, 15)],
"day_count": "ACT/ACT",
"payment_convention": "Following",
"payment_calendar": "TARGET",
"settlement_days": 2,
"first_call": "2030-05-15",
"call_price": 100.0,
"reset": {"date": "2030-05-15", "margin": 0.0425},
}
res = calculate(terms, clean=98.5, price_date=date(2026, 6, 1))
print(f"YTC: {res['ytc']:.4%}, ModDur: {res['modified_duration']:.2f}, DV01: {res['dv01_per_100']:.4f}")
ytw = ytp_from_reset(terms, clean=98.5, price_date=date(2026, 6, 1), reset_swap_rate=0.025)
print(f"YTP: {ytw['ytp']:.4%}, YTW: {ytw['ytw']:.4%} ({ytw['workout_regime']})")
g = treasury_g_spread(ytm=0.055, years=4.0, curve={2.0: 0.041, 5.0: 0.044})
print(f"G-spread: {g['g_spread_bps']:.1f} bp")
License
MIT — see LICENSE.
Metadata
Release files for callable-bond-analytics 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| callable_bond_analytics-0.1.0.tar.gz | 49.6 kB | Without provenance | Details for callable_bond_analytics-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| callable_bond_analytics-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for callable_bond_analytics-0.1.0-py3-none-any.whl |
Total release size: 62.5 kB
Release files / callable_bond_analytics-0.1.0.tar.gz
| Download URL | callable_bond_analytics-0.1.0.tar.gz |
|---|---|
| Size | 49.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67d2a9bd012cbedd784d5d2865329a0d0787596fe4d21bd07c216d4ed0b52cef
|
|
BLAKE2b-256 checksum How to use checksums |
81024dba94543636c6d6c84d523ca56312d8b8cbaabbf526a8b88769f10f44f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / callable_bond_analytics-0.1.0-py3-none-any.whl
| Download URL | callable_bond_analytics-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf291d18cfd8cf40718981e40a4f83a9a63b4e8144359adbc4b74ceb186db093
|
|
BLAKE2b-256 checksum How to use checksums |
a76a4b841783af90a6ef6d795d95d138e5f3fa83471d3480838988b519563043
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for callable-bond-analytics 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.