Skip to content
domokanePublic

About

A Python Finance Library that focuses on the pricing and risk-management of Financial Derivatives, including fixed-income, equity, FX and credit derivatives.

Topics

Resources

Contributing

Stars

3.2k stars

Watchers

64 watching

Forks

Repository files navigation

FinancePy logo

Financial derivatives pricing and risk analytics in Python

Readable financial models. Practical valuation tools. Python performance with Numba.

PyPI Python License: GPL-3.0-or-later GitHub stars

Documentation · Quick start · Examples · Report an issue


What is FinancePy?

FinancePy is an open-source Python library for the valuation and risk analysis of financial securities and derivatives. It covers instruments across fixed income, equities, foreign exchange and credit, with an emphasis on code that can be inspected, understood and extended.

FinancePy is designed for quantitative analysts, risk managers, traders, educators and students who want to explore how financial instruments are priced and risk-managed. It is an excellent starting point for researchers wishing to test and extend existing models or to develop new models. It is a work-in-progress and contributions are welcome.

Why FinancePy?

  • Broad product coverage — work with bonds, options, swaps and other financial derivatives.
  • Transparent implementations — inspect pricing logic written in Python.
  • Performance-oriented — Numba accelerates computationally intensive models where used.
  • Product-first organization — start from the instrument you want to value, then choose a model and market inputs.
  • Learn by example — explore scripts, notebooks and API documentation.

A Simple Core idea:

Valuation = Product + Model + Market Data

Quick start

1. Install

FinancePy is available on PyPI:

python -m pip install financepy

To upgrade:

python -m pip install --upgrade financepy

2. Verify your installation

from financepy.utils import Date

settlement_date = Date(19, 2, 2026)
print(settlement_date.add_days(2))
# 21-FEB-2026

Note: The first use of some models can take longer while Numba compiles and caches optimized code. Subsequent runs can be faster.

3. Explore a pricing example

Start with the ready-to-run example scripts or Jupyter notebooks. These illustrate how to construct products, provide market data, select models and calculate valuations.

What can you model?

Area Examples of functionality
Fixed income Bonds, interest-rate curves, swaps and swaptions
Equity derivatives Equity options and associated pricing models
Foreign exchange FX derivatives and volatility surfaces
Credit Credit instruments and credit curves
Market data Discount curves, price inputs and volatility structures
Financial utilities Dates, calendars, day counts and schedules

Coverage varies by product and model. Consult the API documentation and examples for the supported interfaces.

How FinancePy is organized

The library separates the instrument, the pricing model and the market inputs so that each can be examined independently.

financepy/
├── products/    # Financial instruments and their valuation interfaces
├── models/      # Low-level analytical and Monte Carlo pricing and valuation models
├── market/      # Curves, volatility and other market data
└── utils/       # Dates, calendars, schedules and general mathematics

This product-oriented design helps users find the instrument they need without first navigating every available mathematical model.

Documentation and learning resources

Resource Description
API reference Classes, functions and method documentation
Quick-start guides Introductions to major product areas
Example scripts Runnable examples for products and models
Jupyter notebooks Interactive experiments and tutorials
Changelog Changes across releases

Design philosophy

FinancePy aims to balance clarity, coverage and speed:

  1. Keep financial calculations understandable to readers with working Python knowledge.
  2. Make model implementations inspectable rather than hiding them behind compiled extensions.
  3. Use Numba to improve performance where appropriate.
  4. Organize functionality around financial products and practical valuation tasks.
  5. Provide examples and tests that help users verify results and learn the models.

Numerical results can differ from those of other financial systems because of conventions, curve construction, interpolation choices or model assumptions. Validate inputs and outputs for your own use case.

Contributing

Contributions from developers and finance practitioners are welcome. You can help by fixing bugs, improving documentation, adding tests, extending examples or proposing new products and models.

Before beginning a substantial change, open an issue or comment on an existing one to coordinate work.

For more information see contributing

Project status and support

FinancePy is an open-source project. If you find a defect, need a feature or want to suggest a valuation example, please create an issue with enough detail to reproduce or evaluate the request.

Disclaimer: FinancePy is provided without warranty. Financial calculations should be independently checked before being used for trading, investment or risk-management decisions.

Author

FinancePy was created by Dominic O'Kane, drawing on experience in quantitative finance, industry and academia.

License

FinancePy is licensed under GPL-3.0-or-later. See the LICENSE file for details.


Explore the models · Learn from the examples · Contribute to open quantitative finance

Documentation · Examples · GitHub

About

A Python Finance Library that focuses on the pricing and risk-management of Financial Derivatives, including fixed-income, equity, FX and credit derivatives.

Topics

Resources

Contributing

Stars

3.2k stars

Watchers

64 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages