{"id":23375,"library":"bond-pricing","title":"bond_pricing","description":"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.","status":"active","version":"0.7.3","language":"python","source_language":"en","source_url":"https://github.com/jrvarma/bond_pricing","tags":["finance","bonds","ytm","npv","irr","annuity"],"install":[{"cmd":"pip install bond-pricing","lang":"bash","label":"Install latest release"}],"dependencies":[],"imports":[{"note":"Main class for bond calculations.","symbol":"Bond","correct":"from bond_pricing import Bond"},{"note":"Function to construct zero-coupon yield curve.","symbol":"zero_curve","correct":"from bond_pricing import zero_curve"},{"note":"Annuity present value calculation.","symbol":"annuity","correct":"from bond_pricing import annuity"},{"note":"Internal rate of return.","symbol":"irr","correct":"from bond_pricing import irr"}],"quickstart":{"code":"from bond_pricing import Bond\nbond = Bond(face_value=1000, coupon_rate=0.05, maturity=10, price=950)\nprint(bond.ytm())","lang":"python","description":"Create a bond and compute yield to maturity."},"warnings":[{"fix":"Ensure face_value is numeric.","message":"Face value must be provided as a number (int or float) and cannot be a string. Passing a string will raise a TypeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `bond.price(ytm=0.05)` instead of `bond.price_from_ytm(0.05)`.","message":"The method `price_from_ytm()` is deprecated in 0.7.0 in favor of `price()`.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Use keyword argument `rates` instead of `spot_rates`.","message":"In version 0.7.0, the `zero_curve` function signature changed: the argument `spot_rates` renamed to `rates`.","severity":"breaking","affected_versions":"==0.7.0, <0.7.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to latest: pip install --upgrade bond-pricing","cause":"Importing from wrong module or version mismatch. Older version (<=0.6.x) used different parameter names.","error":"TypeError: __init__() got an unexpected keyword argument 'face_value'"},{"fix":"Update library or use bond.yield_to_maturity() for older versions.","cause":"Using an outdated version where method was named differently (e.g., 'yield_to_maturity').","error":"AttributeError: 'Bond' object has no attribute 'ytm'"},{"fix":"Ensure maturity > 0.","cause":"Passing a negative or zero maturity value.","error":"ValueError: Maturity must be positive"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}