skillfed

py-lets-be-rational

Pure python implementation of Peter Jaeckel's LetsBeRational.

py-lets-be-rational v1.1.2 120.9K downloads/30d#12,004 on PyPI73
Permissive license MIT Active released

What it is and what it does

py-lets-be-rational is a Python implementation of Peter Jaeckel's LetsBeRational algorithm for computing implied volatility from option prices. It solves the inverse problem of Black's model—given an observed option price, it calculates the volatility that would produce that price—using a highly efficient numerical method. The package provides a pure Python implementation that works out of the box, with an optional Numba dependency for JIT compilation and faster execution.

The package depends on numpy for numerical operations and maintains backward compatibility with the historical py_lets_be_rational import path. Installation is straightforward on modern Python (3.9–3.14), though users seeking Numba acceleration must handle OS-specific LLVM setup separately. It is actively maintained and carries a permissive MIT license.

Use it for:

  • Computing implied volatility from observed option market prices for Greeks and risk calculations.
  • Building implied volatility surfaces across strikes and maturities from option quotes.
  • Calibrating option pricing models by extracting market-implied volatility parameters.
  • Backtesting trading strategies that depend on fast, accurate volatility inference.
  • Constructing volatility indices or term structures for portfolio analysis.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Computes implied volatility from option prices using Peter Jaeckel's LetsBeRational algorithm, with optional Numba acceleration for speed.

Yes. The package solves a well-defined, computationally intensive problem with a proven algorithm. It has low installation friction, active maintenance, MIT licensing, no known vulnerabilities, and broad Python version support (3.9–3.14). The pure Python fallback ensures it works immediately; optional Numba acceleration is available for users willing to handle system-level dependencies. Suitable for production use in option analytics workflows.

Install

py-lets-be-rational on PyPI

pip

pip install py-lets-be-rational

uv

uv add py-lets-be-rational

poetry

poetry add py-lets-be-rational

Installing py-lets-be-rational

Before you install

Low friction installation with a pure Python fallback; the package is actively maintained (last commit 2026-05-29) and supports modern Python versions 3.9–3.14. Optional Numba dependency can improve speed but requires separate system-level LLVM installation, which the documentation acknowledges as OS-dependent.

License in practice

MIT license (permissive) allows free use, modification, and distribution with minimal restrictions. The original algorithm carries a historical copyright notice from Peter Jäckel with a simple warranty disclaimer.

Quickstart

pip install py-lets-be-rational

import numpy
# Implied volatility computation via the package's algorithm

Optional Numba acceleration requires LLVM 3.9 and llvm-lite installation, which is OS-dependent; pure Python mode works without it but runs slower.

Verify before relying

  • What functions or classes the package exports for computing implied volatility.
  • Whether the package's pure Python implementation is sufficiently fast for production use without Numba in typical workflows.
  • Current status and compatibility of the Numba optional dependency (documentation references numba==0.31.0, which is very old).
  • What cody-special and piecewise-rational runtime dependencies contribute to the package.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — cody-special, numpy, piecewise-rational
Maintenance actively maintained — 76 days since the last release
Last repo commit
First released
Downloads 120,919/month — #12,004 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_lets_be_rational-1.1.2-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

implied volatility calculationoption pricing black volatilitylets be rational algorithmfast implied vol computationblack scholes inverseoption analytics python
quantitative-financeoption-pricingnumerical-methods

More Mathematics packages