Show HN: Every site gives a different P/E ratio, so I open-sourced the math A developer open-sourced a Python library called Finance Toolkit to address discrepancies in P/E ratios across financial data providers. The library documents formulas for over 200 metrics, offering transparency on calculations like diluted vs. basic shares and trailing vs. fiscal-year earnings. The project aims to standardize financial metric reporting. Microsoft's P/E on May 6, 2023: Stockopedia says 28.93, Morningstar 32.05, Macrotrends 32.66, Yahoo Finance 33.80, Companies Market Cap 34.4. Same company, same date, eight different numbers. The usual causes: trailing-twelve-month vs fiscal-year-end earnings, diluted vs basic shares, different treatment of extraordinary items. Most providers don't document which they use. In the meantime, I report it at 32.07 diluted , 31.96 non-diluted , 30.07 TTM diluted and 29.93 TTM non-diluted . That is why I built the Finance Toolkit: an open-source MIT Python library where every one of 200+ metrics has its formula in the source. Entirely free to use and includes a MCP server as well. Comments URL: https://news.ycombinator.com/item?id=48682935 https://news.ycombinator.com/item?id=48682935 Points: 1 Comments: 0