vollib
Python library for calculating option prices, implied volatility and greeks.
What it is and what it does
vollib is a Python library for quantitative finance that computes option prices, implied volatility, and Greeks (sensitivity measures) using three classical pricing models: Black, Black-Scholes, and Black-Scholes-Merton. At its core is an extremely fast algorithm from Peter Jaeckel's "Let's Be Rational" paper for deriving implied volatility from observed option prices—a computationally intensive inverse problem that vollib solves to high precision in just two iterations. The library provides both analytical and numerical implementations of Greeks for each model, letting users choose between speed and numerical robustness.
The package depends on numpy, scipy, pandas, and simplejson for numeric computation, plus specialized finance libraries cody-special and piecewise-rational. It is actively maintained, supports Python 3.9–3.13, and installs cleanly as a pure-Python wheel. Strike prices must be strictly positive; the library does not special-case zero or negative strikes and will raise an error if given them. Existing code using the deprecated py_vollib namespace will still work for now, but new code should import directly from vollib.
Use it for:
- Calculate option prices and Greeks for hedging and risk management in derivatives trading.
- Infer implied volatility from market option prices to assess market expectations of future volatility.
- Backtest option trading strategies by computing prices and sensitivities across different market scenarios.
- Validate or calibrate volatility models by comparing theoretical prices to market data.
- Build financial analytics dashboards that require real-time Greeks and price updates for options portfolios.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
vollib calculates option prices, implied volatility, and Greeks using Black, Black-Scholes, and Black-Scholes-Merton models, with fast implied volatility computation via Peter Jaeckel's LetsBeRational algorithm.
Yes. vollib is actively maintained, has no known vulnerabilities, installs with low friction, and is the canonical package for classical option pricing in Python. Use it if you need Black, Black-Scholes, or Black-Scholes-Merton pricing or implied volatility. Verify that the pure-Python implementation meets your performance requirements before deploying to latency-critical systems.
Install
vollib on PyPI
pip
pip install vollibuv
uv add vollibpoetry
poetry add vollibInstalling vollib
Before you install
Low friction install with pure-Python wheels. Actively maintained as of 2026-05-29 with recent release (1.0.11 on 2026-06-01). Supports Python 3.9–3.13 and depends on standard numeric libraries (numpy, scipy, pandas) plus specialized finance packages.
License in practice
MIT license is permissive; no restrictions on commercial use, modification, or redistribution. Includes Peter Jaeckel's LetsBeRational code under a similar permissive license with warranty disclaimer.
Quickstart
pip install vollib
from vollib.black_scholes import black_scholes
from vollib.black_scholes.implied_volatility import implied_volatility
price = black_scholes('c', S=100, K=100, t=0.5, r=0.01, sigma=0.2)
iv = implied_volatility(price, S=100, K=100, t=0.5, r=0.01, flag='c')
Strike prices (K) must be strictly positive; K ≤ 0 raises ZeroDivisionError or ValueError. Requires Python 3.9 or later.
Verify before relying
- Numerical accuracy and performance characteristics compared to other option pricing libraries.
- Whether analytical vs. numerical Greeks implementation choice affects typical use cases.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — cody-special, lets-be-rational, numpy, pandas, piecewise-rational, scipy, simplejson |
| Maintenance | actively maintained — 74 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 124,688/month — #11,855 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: vollib-1.0.11-py3-none-any.whl
Tags
More Financial packages
statsmodels provides statistical models,…
permissive · top 1,000 on PyPI
yfinanceFetches financial and market data from Yahoo…
permissive · top 1,000 on PyPI
bokehBokeh is an interactive visualization library…
permissive · top 5,000 on PyPI
python-stdnumParses, validates, and reformats standard…
copyleft · top 5,000 on PyPI
panelPanel is a Python framework for building…
permissive · top 5,000 on PyPI
databentoOfficial Python client for accessing live and…
permissive · top 5,000 on PyPI
py-vollibCalculates option prices, implied volatility,…
permissive · top 15,000 on PyPI
py-lets-be-rationalComputes implied volatility from option prices…
permissive · top 15,000 on PyPI
volatility3Volatility 3 is a memory forensics framework…
unclear · top 15,000 on PyPI
taComputes technical analysis indicators (volume,…
permissive · top 5,000 on PyPI
pyportfoliooptPyPortfolioOpt implements portfolio…
permissive · top 15,000 on PyPI
QuantLibQuantLib provides Python bindings to a C++…
permissive · top 5,000 on PyPI
quantstatsQuantStats computes portfolio performance…
permissive · top 15,000 on PyPI
linearmodelsProvides panel regression, instrumental…
unclear · top 15,000 on PyPI
numpy-financialProvides elementary financial functions (IRR,…
permissive · top 5,000 on PyPI