2026-02-12 14:58:57 +00:00
# 10-K Financial Analyzer
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
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** .
2026-02-12 14:48:19 +00:00
---
2026-02-12 14:58:57 +00:00
## Tech Stack
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
- **UI**: Streamlit
- **Data**: sec-edgar-downloader (SEC EDGAR)
- **AI**: Google Gemini (google-generativeai)
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
---
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
## Requirements
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
- Python 3.9+
- [Google API Key (Gemini) ](https://aistudio.google.com/apikey )
- 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
2026-02-12 14:48:19 +00:00
```bash
2026-02-12 14:58:57 +00:00
cd "/path/to/your/FQDC Project"
2026-02-12 14:48:19 +00:00
```
2026-02-12 14:58:57 +00:00
Replace with your actual project path if different.
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
### 3. Create a virtual environment (recommended, one-time)
2026-02-12 14:48:19 +00:00
```bash
python3 -m venv venv
```
2026-02-12 14:58:57 +00:00
### 4. Activate the virtual environment
2026-02-12 14:48:19 +00:00
**Mac / Linux:**
```bash
source venv/bin/activate
```
2026-02-12 14:58:57 +00:00
**Windows (Command Prompt):**
2026-02-12 14:48:19 +00:00
```bash
venv\S cripts\a ctivate.bat
```
**Windows (PowerShell):**
```bash
venv\S cripts\A ctivate.ps1
```
2026-02-12 14:58:57 +00:00
You should see `(venv)` at the start of your prompt.
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
### 5. Install dependencies
2026-02-12 14:48:19 +00:00
```bash
pip install -r requirements.txt
```
2026-02-12 14:58:57 +00:00
Requires an internet connection; may take 1– 2 minutes.
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
### 6. Run the app
2026-02-12 14:48:19 +00:00
```bash
streamlit run app.py
```
2026-02-12 14:58:57 +00:00
Your browser should open at `http://localhost:8501` . If not, open that URL manually.
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
### 7. Configure and analyze
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
1. In the **sidebar** :
- **Google API Key (Gemini)**: paste your key from [Google AI Studio ](https://aistudio.google.com/apikey )
- **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, you’ ll see the **Detailed Analysis** , **CFA Investment Report** , and (if not in Analysis only mode) the **Key Financial Metrics** table.
2026-02-12 14:48:19 +00:00
---
2026-02-12 14:58:57 +00:00
## Stopping the app
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
Press `Ctrl + C` in the terminal.
2026-02-12 14:48:19 +00:00
---
2026-02-12 14:58:57 +00:00
## Project structure
2026-02-12 14:48:19 +00:00
```
FQDC Project/
2026-02-12 14:58:57 +00:00
├── app.py # Streamlit app (Gemini)
├── requirements.txt # Python dependencies
├── .env.example # Example env vars (copy to .env and fill in)
└── README.md # This file
2026-02-12 14:48:19 +00:00
```
---
2026-02-12 14:58:57 +00:00
## Troubleshooting
2026-02-12 14:48:19 +00:00
2026-02-12 14:58:57 +00:00
- **"Could not find 10-K file"**
- Check the ticker (e.g. AAPL, MSFT).
- Ensure you’ re 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 2– 5 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 ](https://www.sec.gov/os/webmaster-faq#code-support ).
When using AI output, comply with Google’ s terms of use for the Gemini API.