{"slug": "show-hn-every-site-gives-a-different-p-e-ratio-so-i-open-sourced-the-math", "title": "Show HN: Every site gives a different P/E ratio, so I open-sourced the math", "summary": "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.", "body_md": "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).\n\nThat 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.\n\nComments URL: [https://news.ycombinator.com/item?id=48682935](https://news.ycombinator.com/item?id=48682935)\n\nPoints: 1\n\n# Comments: 0", "url": "https://wpnews.pro/news/show-hn-every-site-gives-a-different-p-e-ratio-so-i-open-sourced-the-math", "canonical_source": "https://github.com/JerBouma/FinanceToolkit", "published_at": "2026-06-26 06:13:19+00:00", "updated_at": "2026-06-26 06:35:09.860312+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Microsoft", "Stockopedia", "Morningstar", "Macrotrends", "Yahoo Finance", "Companies Market Cap", "Finance Toolkit"], "alternates": {"html": "https://wpnews.pro/news/show-hn-every-site-gives-a-different-p-e-ratio-so-i-open-sourced-the-math", "markdown": "https://wpnews.pro/news/show-hn-every-site-gives-a-different-p-e-ratio-so-i-open-sourced-the-math.md", "text": "https://wpnews.pro/news/show-hn-every-site-gives-a-different-p-e-ratio-so-i-open-sourced-the-math.txt", "jsonld": "https://wpnews.pro/news/show-hn-every-site-gives-a-different-p-e-ratio-so-i-open-sourced-the-math.jsonld"}}