Good Company

Is this a good company? Should I invest?

Gemini 2.5 Flash FastAPI PyMuPDF Local PDF Reader 7-Step Analysis

Project Overview

Problem: Evaluating whether a company is worth investing in requires reading dense quarter reports and cross-referencing multiple analytical frameworks. Most retail investors either skip the analysis entirely or rely on surface-level metrics.

Solution: Good Company reads quarter report PDFs directly from your local device and runs a structured 7-step analysis. It separates two distinct questions: "Is this a good business?" and "Is this a good stock?" — because a good company is not always a good investment.

How It Works

Drop a quarter report PDF into the designated folder. The app reads it locally (nothing is uploaded), sends the text to Gemini for analysis, and presents results with visual scorecards, metric cards, and color-coded verdicts.

Analysis Pipeline

The analysis is split into two phases, a supplementary section, and a final scorecard:

StepNameWhat It AnswersVisual Output
Phase 1Is this a good company?
Step 1Company OverviewWhat does this company do and how does it make money?Metric cards (revenue, profit, EPS, margin)
Step 2Forensic CheckAre the numbers trustworthy?Green/yellow/red scorecard
Step 3VerdictGood business, good stock, both, or neither?Verdict badge + dimension score bars
Read MoreSupplementary reports (on demand)
Deep DiveFull business model analysisText only
Earnings BreakdownWhat improved, what got worseText only
Stress TestBull / base / bear scenarios3 scenario cards
Company ComparisonHead-to-head vs another stockComparison table with scores
Phase 2Should I invest?
Step 4Valuation CheckIs it cheap, fair, or expensive?Cheap/fair/expensive range bar
Step 5Bull vs BearStrongest case for and againstBull/bear tally bar
Step 6Personal Risk CheckShould I buy given my price, horizon, and risk tolerance?Text only
Step 7Final ScorecardDoes it pass my personal screening criteria?7-dimension scorecard + PASS/BORDERLINE/FAIL

Application Features

Local PDF Reading

Reads quarter report PDFs directly from your device via MCP pattern. No upload needed. Files never leave your machine.

Phase 1: Company Quality

Three automated steps: company overview with key metrics, forensic accounting check for red flags, and a 4-way verdict classification.

Read More Reports

Four on-demand supplementary reports available after Phase 1, regardless of whether the company is good or bad. Includes company comparison.

Phase 2: Investment Decision

Personalized to your purchase price, time horizon, and risk tolerance. Valuation framework, bull/bear debate, and direct risk advice.

Final Scorecard

Scores the company against a 7-dimension personal investment yardstick: fundamentals, financial health, valuation, moat, cash flow, management, and liquidity.

Copy Report

One-click copy of all opened sections as formatted text. Paste into Notebook LLM, Notepad, or any document for further analysis.

Technical Architecture

Backend

Python 3 FastAPI Gemini 2.5 Flash PyMuPDF (PDF parsing) python-dotenv

Frontend

Single-page HTML Vanilla JavaScript marked.js (Markdown) CSS Grid / Flexbox

Architecture

Setup & Installation

Prerequisites

Quick Start

# Clone the repository git clone https://github.com/lyven81/ai-project.git cd ai-project/projects/good-company # Install dependencies pip install -r requirements.txt # Set API key echo "GEMINI_API_KEY=your-key-here" > .env # Create report folder and add PDFs mkdir "Quarter report" # Run the app python main.py

File Naming Convention

Quarter report/ Dialog - 6 Apr 26.pdf Padini - 5 Feb 26.pdf Apollo - 29 Jan 26.pdf

Pattern: Company Name - DD Mon YY.pdf. The app parses the date for sorting (newest first).

Key Metrics

7
Analysis Steps
10
Prompt Templates
7
Visual Output Types
~$0.02
Cost per Full Analysis