Microsoft's P/E on May 6, 2023 ranged from 28.93 to 34.4 across eight sources — same company, same date. TTM vs fiscal year, diluted vs basic, different treatment of extraordinary items. Most providers don't document which they use.
That's why I built FinanceToolkit: 200+ financial metrics, every formula in the source code. Open-source, free, with an MCP server included.
The FinanceToolkit is a comprehensive open-source Python library designed for transparent and reproducible financial analysis. The project was created to address a specific and pervasive problem: the same financial metric, calculated for the same company on the same day, regularly produces different results depending on which data provider you consult.
As a concrete example: Microsoft's Price-to-Earnings ratio on May 6, 2023 was reported as 28.93 (Stockopedia), 32.05 (Morningstar), 32.66 (Macrotrends), 33.09 (Finance Charts), 33.66 (Y Charts), 33.67 (Wall Street Journal), 33.80 (Yahoo Finance), and 34.4 (Companies Market Cap). All of these are technically defensible calculations, but the variation is large enough to mislead any investor trying to compare across sources. Worse, most providers bury their methodology behind a paid subscription. The FinanceToolkit solves this by writing every formula in plain Python, publicly committed to GitHub, so the calculation method is always visible and auditable.
Key Features
Wide Range of Financial Instruments: Not limited to equities, the toolkit supports options, currencies, cryptocurrencies, ETFs, mutual funds, indices, money markets, commodities, and fixed income instruments. This lets you perform cross-asset analysis without switching tools or normalizing data from different sources manually.
30+ Years of Financial Statement Data: Annual and quarterly financial statements going back over three decades are accessible through a single initialization. The toolkit automatically standardizes these statements into a consistent schema across all tickers, converts fiscal year dates to calendar year equivalents so companies can be compared on the same basis, and optionally converts currencies so that market price and financial statement figures are always denominated in the same currency before ratio calculations.
200+ Financial Metrics: Every ratio, indicator and model has a corresponding function with a fully documented, open-source formula. This includes valuation ratios, profitability metrics, liquidity and solvency ratios, efficiency metrics, performance measurements, risk metrics, technical indicators, options Greeks, factor model outputs, and macroeconomic indicators.
Historical Data with Built-in Risk Metrics: Retrieve OHLC price history on daily, weekly, monthly, quarterly, or yearly intervals. Each time series automatically includes return, volatility, excess return, excess volatility, and cumulative return columns. Benchmark comparison against any ticker (defaulting to SPY) is built in, enabling calculations like CAPM, Alpha, and Beta without any additional setup.
Finance Database Integration: The Finance Database contains 300,000+ financial symbols spanning equities (160,869 across 117 countries and 84 exchanges), ETFs (36,483), funds (57,853), indices (91,181), currencies (2,556), cryptocurrencies (3,367), and money markets (1,367). Each record carries structured metadata: sector, industry group, industry, exchange, market cap tier, ISIN, CUSIP, FIGI, and website. The two projects are directly integrated: after filtering the database for the instruments you want, calling .to_toolkit() on the result passes those tickers directly into the FinanceToolkit with all parameters preserved.
MCP Server: The Finance Toolkit is available as a Model Context Protocol (MCP) server, allowing Claude, Copilot, Cursor, Windsurf, or any MCP-compatible client to query 200+ financial metrics without writing code. The server groups all methods into ~21 categorical tools, each with a results cache that prevents redundant API calls when multiple metrics share the same underlying financial statements.
Installation
pip install financetoolkit -U
Then within Python:
from financetoolkit import Toolkit
companies = Toolkit(
tickers=['AAPL', 'MSFT'],
api_key='YOUR_FMP_API_KEY',
start_date='2017-12-31',
)
An API key from FinancialModelingPrep unlocks 30+ years of financial statement data, both annual and quarterly. The free plan covers 250 requests per day and 5 years of history for US-listed companies. If FinancialModelingPrep data is unavailable for a given request, the toolkit automatically falls back to Yahoo Finance as a secondary source.
No comments yet.
Sign in to be the first to comment.