Use the vollib.black_scholes package
masterThe vollib.black_scholes package provides tools for Black-Scholes option pricing and related calculations. It is organized into subpackages and submodules to handle different aspects of financial mathematics.
Key components include:
vollib.black_scholes.greeks: A subpackage containing functions to calculate various Greeks (sensitivities).vollib.black_scholes.implied_volatility: A submodule dedicated to calculating implied volatility from option prices.- Core
vollib.black_scholesmodule: Provides the primary interface for Black-Scholes calculations.