# marcosan93/stock-analyzer architecture

> Architecture diagram of the GitHub repository marcosan93/stock-analyzer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marcosan93/stock-analyzer
- Repository: https://github.com/marcosan93/stock-analyzer

## Overview

Stock Analyzer is an interactive Streamlit application for fundamental Buy/Hold/Sell classification, technical price forecasting, and Twitter sentiment analysis. A user selects a stock and analysis method; the app prepares data or retrieves it, applies the relevant model or sentiment scoring, and presents charts. The README also documents separate notebook workflows for collecting, cleaning, exploring, and training on each data type. Evidence is limited to the README and partial Presentation.py excerpts, so unsampled notebook-level connections are not inferred.

Main entry points: [`Presentation.py`](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py) (Streamlit interface), [`Classification`](https://github.com/marcosan93/stock-analyzer/tree/master/Classification) (Fundamental data), [`Classification/classifier_model.joblib`](https://github.com/marcosan93/stock-analyzer/blob/master/Classification/classifier_model.joblib) (XGBoost classifier), [`Time_Series`](https://github.com/marcosan93/stock-analyzer/tree/master/Time_Series) (Closing-price data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Interactive analysis"]
  node_ui["Streamlit interface<br/>[Presentation.py]"]
end

subgraph group_fundamental["Fundamental analysis"]
  node_fundamental_data[("Fundamental data")]
  node_fundamental_prep["Feature preparation<br/>[Presentation.py]"]
  node_classifier["XGBoost classifier"]
  node_class_results["Class probabilities<br/>[Presentation.py]"]
  node_classification_work["Classifier experiments"]
end

subgraph group_technical["Technical analysis"]
  node_price_data[("Closing-price data")]
  node_price_scraper["Price retrieval<br/>[Presentation.py]"]
  node_forecast_prep["Forecast preparation<br/>[Presentation.py]"]
  node_prophet["Prophet forecast<br/>[Presentation.py]"]
  node_time_series_work["Time-series models"]
end

subgraph group_sentiment["Sentiment analysis"]
  node_tweets["Tweet collection<br/>[Presentation.py]"]
  node_sentiment_scoring["Sentiment scoring<br/>[Presentation.py]"]
  node_sentiment_charts["Sentiment charts<br/>[Presentation.py]"]
  node_sentiment_work["Sentiment workflow"]
end

node_user(("Stock analyst"))
node_stockpup(("Stockpup"))
node_yahoo(("Yahoo Finance"))
node_twitter(("Twitter"))

node_user -->|"selects analysis"| node_ui
node_ui -->|"prepares features"| node_fundamental_prep
node_fundamental_data -->|"supplies reports"| node_fundamental_prep
node_stockpup -->|"provides reports"| node_fundamental_data
node_ui -->|"requests probabilities"| node_classifier
node_fundamental_prep -->|"supplies features"| node_classifier
node_classifier -->|"returns probabilities"| node_class_results
node_class_results -->|"displays chart"| node_ui
node_fundamental_data -->|"trains models"| node_classification_work
node_ui -->|"requests prices"| node_price_scraper
node_price_scraper -->|"downloads prices"| node_yahoo
node_price_scraper -->|"saves CSV"| node_price_data
node_price_data -->|"provides prices"| node_forecast_prep
node_ui -->|"formats forecast input"| node_forecast_prep
node_ui -->|"runs forecast"| node_prophet
node_forecast_prep -->|"supplies time series"| node_prophet
node_ui -->|"offers model workflows"| node_time_series_work
node_ui -->|"requests tweets"| node_tweets
node_tweets -->|"searches tweets"| node_twitter
node_tweets -->|"scores tweets"| node_sentiment_scoring
node_sentiment_scoring -->|"provides scores"| node_sentiment_charts
node_sentiment_charts -->|"renders charts"| node_ui
node_twitter -->|"supplies tweets"| node_sentiment_work

click node_ui "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_fundamental_data "https://github.com/marcosan93/stock-analyzer/tree/master/Classification"
click node_fundamental_prep "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_classifier "https://github.com/marcosan93/stock-analyzer/blob/master/Classification/classifier_model.joblib"
click node_class_results "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_classification_work "https://github.com/marcosan93/stock-analyzer/tree/master/Classification"
click node_price_data "https://github.com/marcosan93/stock-analyzer/tree/master/Time_Series"
click node_price_scraper "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_forecast_prep "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_prophet "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_time_series_work "https://github.com/marcosan93/stock-analyzer/tree/master/Time_Series"
click node_tweets "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_sentiment_scoring "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_sentiment_charts "https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py"
click node_sentiment_work "https://github.com/marcosan93/stock-analyzer/tree/master/Sentiment"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui toneBlue
class node_fundamental_data,node_fundamental_prep,node_classifier,node_class_results,node_classification_work toneAmber
class node_price_data,node_price_scraper,node_forecast_prep,node_prophet,node_time_series_work toneMint
class node_tweets,node_sentiment_scoring,node_sentiment_charts,node_sentiment_work toneRose
class node_user,node_stockpup,node_yahoo,node_twitter toneIndigo
```

## Components

### Interactive analysis

- [Streamlit interface](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`

### Fundamental analysis

- [Fundamental data](https://github.com/marcosan93/stock-analyzer/tree/master/Classification): `Classification`
- [Feature preparation](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [XGBoost classifier](https://github.com/marcosan93/stock-analyzer/blob/master/Classification/classifier_model.joblib): `Classification/classifier_model.joblib`
- [Class probabilities](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [Classifier experiments](https://github.com/marcosan93/stock-analyzer/tree/master/Classification): `Classification`

### Technical analysis

- [Closing-price data](https://github.com/marcosan93/stock-analyzer/tree/master/Time_Series): `Time_Series`
- [Price retrieval](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [Forecast preparation](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [Prophet forecast](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [Time-series models](https://github.com/marcosan93/stock-analyzer/tree/master/Time_Series): `Time_Series`

### Sentiment analysis

- [Tweet collection](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [Sentiment scoring](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [Sentiment charts](https://github.com/marcosan93/stock-analyzer/blob/master/Presentation.py): `Presentation.py`
- [Sentiment workflow](https://github.com/marcosan93/stock-analyzer/tree/master/Sentiment): `Sentiment`

### Other components

- **Stock analyst**
- **Stockpup**
- **Yahoo Finance**
- **Twitter**

## Connections

- Stock analyst → Streamlit interface: selects analysis (evidence: `Presentation.py`)
- Streamlit interface → Feature preparation: prepares features (evidence: `Presentation.py`)
- Fundamental data → Feature preparation: supplies reports (evidence: `README.md`)
- Stockpup → Fundamental data: provides reports (evidence: `README.md`)
- Streamlit interface → XGBoost classifier: requests probabilities (evidence: `Presentation.py`)
- Feature preparation → XGBoost classifier: supplies features (evidence: `Presentation.py`)
- XGBoost classifier → Class probabilities: returns probabilities (evidence: `Presentation.py`)
- Class probabilities → Streamlit interface: displays chart (evidence: `Presentation.py`)
- Fundamental data → Classifier experiments: trains models (evidence: `README.md`)
- Streamlit interface → Price retrieval: requests prices (evidence: `Presentation.py`)
- Price retrieval → Yahoo Finance: downloads prices (evidence: `Presentation.py`)
- Price retrieval → Closing-price data: saves CSV (evidence: `Presentation.py`)
- Closing-price data → Forecast preparation: provides prices (evidence: `Presentation.py`)
- Streamlit interface → Forecast preparation: formats forecast input (evidence: `Presentation.py`)
- Streamlit interface → Prophet forecast: runs forecast (evidence: `Presentation.py`)
- Forecast preparation → Prophet forecast: supplies time series (evidence: `Presentation.py`)
- Streamlit interface → Time-series models: offers model workflows (evidence: `README.md`)
- Streamlit interface → Tweet collection: requests tweets (evidence: `Presentation.py`)
- Tweet collection → Twitter: searches tweets (evidence: `Presentation.py`)
- Tweet collection → Sentiment scoring: scores tweets (evidence: `Presentation.py`)
- Sentiment scoring → Sentiment charts: provides scores (evidence: `Presentation.py`)
- Sentiment charts → Streamlit interface: renders charts (evidence: `Presentation.py`)
- Twitter → Sentiment workflow: supplies tweets (evidence: `README.md`)
