skillfed

vollib

Python library for calculating option prices, implied volatility and greeks.

vollib v1.0.11 124.7K downloads/30d#11,855 on PyPI424
Permissive license MIT Active released

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 vollib

uv

uv add vollib

poetry

poetry add vollib

Installing 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

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.9Topic :: Office/Business :: Financial

Tags

option pricing black scholesimplied volatility calculationgreeks option pricingblack-scholes-merton modeloption price analyticsvolatility from option pricefinancial derivatives pricing
quantitative-financederivatives-pricingvolatility-modeling

More Financial packages