explaingit

jerbouma/financetoolkit

4,767PythonAudience · dataComplexity · 2/5LicenseSetup · easy

TLDR

A Python library that calculates 150+ financial metrics for any stock, ETF, currency, or commodity with full transparency into exactly how each number is computed, no more wondering why different finance sites show different results.

Mindmap

mindmap
  root((FinanceToolkit))
  Data Sources
    Financial Modeling Prep
    Yahoo Finance fallback
    Free API key
  Metrics
    Profitability ratios
    Valuation ratios
    Risk measurements
    Options Greeks
  Asset Classes
    Individual stocks
    ETFs
    Currencies
    Commodities
  Companion Tools
    FinanceDatabase
    300k instruments
    Bulk analysis
  Transparency
    Open source formulas
    Inspect methodology
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Calculate and compare financial ratios for multiple stocks at once using a few lines of Python

USE CASE 2

Pull income statements, balance sheets, and cash flow data from a single consistent source

USE CASE 3

Run risk analysis including Value at Risk and technical indicators on any publicly traded security

USE CASE 4

Verify why different financial websites show different numbers for the same metric

Tech stack

PythonpandasFinancial Modeling Prep APIYahoo Finance

Getting it running

Difficulty · easy Time to first run · 30min

Install with pip, get a free Financial Modeling Prep API key (250 requests/day, 5 years of US stock data). Falls back to Yahoo Finance automatically if the API is unavailable.

MIT license, free to use, modify, and share for any purpose including commercial projects.

In plain English

FinanceToolkit is a Python library for calculating financial metrics in a transparent and consistent way. The motivation behind it is straightforward: the same financial ratio for the same company will often show different values depending on which financial website you look at, because each site uses slightly different formulas and rarely explains their methodology. FinanceToolkit addresses that by publishing all 150+ metrics as open-source code so anyone can inspect exactly how each number is calculated. The library works by taking a list of stock ticker symbols, connecting to financial data sources, and making it easy to run a wide range of calculations in just a few lines of Python. You can pull income statements, balance sheets, and cash flow statements, calculate profitability and valuation ratios, run risk measurements like Value at Risk, analyze options with metrics like the Greeks, and apply technical analysis indicators. The toolkit also covers asset classes beyond individual stocks, including currencies, ETFs, commodities, and macroeconomic indicators. Data comes primarily from a third-party service called Financial Modeling Prep, which requires a free API key to use. The free tier allows up to 250 requests per day and covers five years of historical data for US-listed companies. If that source is unavailable, the library falls back to Yahoo Finance automatically. The README includes an affiliate link to Financial Modeling Prep with a discount, though the author is transparent that this is an affiliate arrangement. The project pairs well with a companion library called FinanceDatabase, also by the same author, which contains metadata for over 300,000 financial instruments. Together they allow you to find tickers by category and then run analysis on them in bulk. Installation is a single pip command, and the basic usage shown in the README requires only a few lines to get historical data, financial statements, or computed ratios for multiple companies at once. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using FinanceToolkit, show me how to calculate the price-to-earnings ratio and profit margin for Apple, Microsoft, and Google and compare them side by side.
Prompt 2
I want to analyze the financial health of a company using FinanceToolkit. Walk me through pulling their balance sheet, income statement, and key profitability ratios.
Prompt 3
How do I use FinanceToolkit to calculate Value at Risk for a stock portfolio containing AAPL, TSLA, and NVDA?
Prompt 4
Show me how to use FinanceToolkit with FinanceDatabase to find all semiconductor ETFs and then calculate their valuation ratios.
Open on GitHub → Explain another repo

← jerbouma on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.