10-K Financial Analyzer

A web app that fetches the latest 10-K from SEC EDGAR for a given stock ticker (e.g. AAPL), then uses Item 7 (MD&A) and Item 8 (Financial Statements) to produce a CFA-style analysis: a detailed summary (financial health, profitability, key risks), a CFA Investment Report section, and key metrics (Revenue, Net Income, Operating Cash Flow). Powered by Google Gemini.


Tech Stack

  • UI: Streamlit
  • Data: sec-edgar-downloader (SEC EDGAR)
  • AI: Google Gemini (google-generativeai)

Requirements

  • Python 3.9+
  • Google API Key (Gemini)
  • An email address for SEC EDGAR (required for programmatic access; use a real address)
  • Optional: .env with GOOGLE_API_KEY and SEC_EDGAR_EMAIL (values will appear in the app sidebar if set)

How to Run

Quick start: Open a terminal, go to the project folder, create/activate a virtual environment, install dependencies, then run the app.

1. Open a terminal

  • Mac: Spotlight (Cmd + Space) → type "Terminal" and open it
  • Windows: Win + R → type cmd and press Enter

2. Go to the project folder

cd "/path/to/your/FQDC Project"

Replace with your actual project path if different.

python3 -m venv venv

4. Activate the virtual environment

Mac / Linux:

source venv/bin/activate

Windows (Command Prompt):

venv\Scripts\activate.bat

Windows (PowerShell):

venv\Scripts\Activate.ps1

You should see (venv) at the start of your prompt.

5. Install dependencies

pip install -r requirements.txt

Requires an internet connection; may take 12 minutes.

6. Run the app

streamlit run app.py

Your browser should open at http://localhost:8501. If not, open that URL manually.

7. Configure and analyze

  1. In the sidebar:
    • Google API Key (Gemini): paste your key from Google AI Studio
    • SEC EDGAR Email Address: your email (for SEC policy compliance)
    • Analysis only (1 API call): check this to use a single API call (useful if you hit rate limits)
  2. Enter a stock ticker (e.g. AAPL, MSFT) and click Run Analysis.
  3. When finished, youll see the Detailed Analysis, CFA Investment Report, and (if not in Analysis only mode) the Key Financial Metrics table.

Stopping the app

Press Ctrl + C in the terminal.


Project structure

FQDC Project/
├── app.py              # Streamlit app (Gemini)
├── requirements.txt    # Python dependencies
├── .env.example        # Example env vars (copy to .env and fill in)
└── README.md           # This file

Troubleshooting

  • "Could not find 10-K file"

    • Check the ticker (e.g. AAPL, MSFT).
    • Ensure youre online and have entered your SEC EDGAR email.
  • "Please enter your Google API Key"

    • Enter your Gemini API key in the sidebar (or set GOOGLE_API_KEY in .env).
  • "Rate limit exceeded"

    • Wait 25 minutes and try again.
    • Enable Analysis only (1 API call) in the sidebar to reduce API usage.
  • Package install errors

    • Run pip install --upgrade pip, then pip install -r requirements.txt again.
  • Encoding issues

    • Set your terminal/IDE encoding to UTF-8.

License and disclaimer

This project is for learning and portfolio use.
When using SEC data, comply with SEC policy.
When using AI output, comply with Googles terms of use for the Gemini API.

S
Description
No description provided
Readme 1.4 MiB
Languages
Python 68%
TypeScript 31.5%
CSS 0.4%
Shell 0.1%