FinancePy: A Python Library That Puts Quantitative Finance Tools in Your Pocket
If you've ever tried to price an option or value a bond in Python, you know the drill: you either reach for a heavyweight proprietary tool, stitch together a half-dozen scattered libraries, or roll your own pricing model from scratch. It's tedious, error-prone, and frankly, a lot of work for something that should be a solved problem. That's where FinancePy comes in—it's a single, open-source Python library designed to handle pricing and risk management for a wide range of financial instruments, and it does it with performance that punches well above its weight.
What It Does
FinancePy is a comprehensive library for quantitative finance. As the README puts it, it's a "one-stop library" for pricing and risk-managing options, futures, and other financial instruments. The project is organized into four clear modules: market for structured data like interest rate curves and volatility surfaces, models for the mathematical engines (think Black-Scholes, Vasicek, and other pricing models), products for the actual instruments like bonds, credit default swaps, and options, and utils for the supporting cast of dates, calendars, and day-count conventions.
The architecture is sensible: you don't typically call the pricing models directly. Instead, you interact with product objects—like an equity_american_option or a bond—and those objects handle the math internally. This keeps the API clean and mirrors how a quant actually thinks about their workflow. Plus, with over 90 example notebooks included, there's a wealth of hands-on documentation to learn from.
Why It's Cool
The real standout feature here is the performance story. FinancePy leans heavily on Numba, a just-in-time compiler for Python, to get calculation speeds that the README compares to C or C++. That's a big deal for a field where you might be running thousands of pricing simulations or sensitivity analyses.
- Speed without leaving Python. You don't have to drop down to C++ or deal with bindings to get fast computations. Numba compiles the heavy math, and you get to stay in a comfortable Python workflow.
- Breadth of coverage. The product list is genuinely impressive. From vanilla bonds to convertible bonds, from simple American options to FX barrier options and variance swaps, from single-name CDS to baskets—it covers a lot of ground across bonds, credit, equity, FX, and rates.
- A thoughtful structure. The separation of market data, models, and products isn't just tidy for its own sake. It makes the library extensible and easier to navigate when you're hunting for a specific tool.
- A practical caveat about first import. The README is refreshingly honest about one quirk: the first import after installation can take a few seconds because Numba compiles the models on the fly. The good news is that this is a one-time cost—the compiled code is cached, so subsequent imports are nearly instant. It's a small price to pay for the speed you get afterward.
How to Try It
Getting started is straightforward. Install it with pip:
pip install financepy
Or upgrade an existing installation with:
pip install --upgrade financepy
Then, in a Python terminal, do a quick sanity check:
from financepy.utils import *
Date(19, 2, 2026).add_days(2)
If everything loaded correctly, you should see 21-FEB-2026 printed back at you. Don't worry if that first import takes a few seconds—it's just Numba doing its initial compile.
From there, the README points you to a dedicated Quick Start Guide to get you up and running in about two minutes. And if you want to dive deeper, the notebooks folder is packed with over 90 examples showing how to use the library in practice.
Final Thoughts
FinancePy isn't trying to be a flashy, all-singing, all-dancing platform. It's a practical, well-organized toolkit for anyone who needs to price or risk-manage financial instruments in Python and doesn't want to sacrifice performance. If you're a quant, a developer working in fintech, or a student exploring mathematical finance, this library is worth a serious look. It's free, open source, and has an active contributor base that welcomes help—provided you're Pep8 compliant and write good comments, that is. For a field where tooling is often proprietary and expensive, having this kind of capability openly available is a genuine gift.
Follow @githubprojects for more developer tools and open source projects.