Skip to content

Medyan-Naser/financial_data_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

341 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Financial Data Analysis Tool

A comprehensive platform for analyzing and visualizing financial statements from publicly traded companies, powered by SEC EDGAR data, AI predictions, and macroeconomic indicators.

Main Application Demo


πŸš€ Features

πŸ“ˆ Financial Data Analysis

  • Real-time Data Collection: Fetch financial statements directly from SEC EDGAR API
  • Comprehensive Coverage: Income statements, balance sheets, and cash flow statements
  • Multi-year Analysis: Historical data spanning 15+ years
  • Interactive Tables: Sortable, filterable financial data tables
  • Dynamic Charts: Create custom charts with multiple metrics and comparison tickers
  • Drag & Resize: Moveable and resizable chart panels for custom layouts

Financial Data Demo

πŸ€– AI-Powered Predictions

  • LSTM Price Forecasting: 11-day stock price predictions using neural networks
  • GARCH Volatility Analysis: Advanced volatility modeling and forecasting
  • Market Indices Tracking: Real-time tracking of SPY, DJIA, NDAQ, and IWM
  • Model Performance Metrics: Detailed evaluation metrics and training loss visualization

AI Predictions Demo

🌍 Macroeconomic Dashboard

  • Commodities: Energy, metals, agricultural, livestock, and industrial commodities
  • Currencies: Major global currency exchange rates
  • Economic Indicators: Inflation (CPI), debt-to-GDP, dollar index, money velocity
  • Labor Market: Unemployment rates and trends
  • Real Estate: Housing market indicators
  • Bond Markets: Global bond yields across regions

⚑ Advanced UI Features

  • Resizable Panels: All charts and visualizations can be resized
  • Draggable Layout: Arrange charts to create custom dashboard layouts
  • Multi-Ticker Comparison: Compare up to multiple tickers simultaneously (comma-separated)
  • Real-time Progress Tracking: Live progress updates during data collection
  • Smart Caching: JSON-based caching for instant data retrieval

πŸ—οΈ Architecture

Backend (Python)

  • FastAPI: High-performance REST API framework
  • Data Collection Service: Automated SEC EDGAR data fetching and processing
  • AI/ML Endpoints: LSTM and GARCH model serving
  • Macro Data Integration: Economic indicators from multiple sources
  • Smart Caching: Automatic CSV cleanup after JSON caching

Frontend (React)

  • React 18: Modern component-based UI
  • Recharts: Interactive financial charts
  • Plotly.js: Advanced plotting for AI/ML visualizations
  • Axios: API communication
  • Draggable/Resizable Components: Custom panel system

Data Collection Pipeline

  1. SEC EDGAR API: Raw financial data retrieval
  2. XML/XBRL Parsing: Financial statement extraction
  3. Data Normalization: Standardized format conversion
  4. Multi-year Merging: Consolidated historical data
  5. JSON Caching: Optimized storage and retrieval

πŸ“¦ Installation

Prerequisites

  • Python 3.8+
  • Node.js 14+
  • npm or yarn

Backend Setup

# Navigate to backend directory
cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the server
uvicorn app.main:app --reload --port 8000
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm start

The application will be available at http://localhost:3000


🎯 Usage

Searching for Stock Data

  1. Enter a ticker symbol (e.g., AAPL, GOOGL, MSFT)
  2. Click "Search" or press Enter
  3. View financial statements in interactive tables
  4. Create custom charts using the Chart Builder

Creating Comparison Charts

  1. Select metrics from the financial table
  2. Choose chart type (Line, Bar, Area)
  3. Add comparison tickers (comma-separated: AMZN,GOOGL,MSFT)
  4. Click "Add Chart" to generate visualization
  5. Drag and resize the chart panel as needed

Running AI Predictions

  1. Navigate to AI tab
  2. Enter ticker symbol
  3. Select model (Price Forecast or Volatility)
  4. Click "Run Model" and wait 30-60 seconds
  5. Interact with results - drag and resize charts

Exploring Economic Data

  1. Navigate to Economy tab
  2. Select category (Commodities, Currencies, etc.)
  3. View interactive charts
  4. Resize and reposition for custom layout

πŸ› οΈ Technologies

Backend

  • FastAPI - Modern Python web framework
  • Pandas - Data manipulation and analysis
  • NumPy - Numerical computing
  • yfinance - Yahoo Finance data
  • requests - HTTP library
  • Beautiful Soup - XML/HTML parsing
  • TensorFlow/Keras - Deep learning (LSTM)
  • arch - GARCH volatility modeling

Frontend

  • React - UI framework
  • Axios - HTTP client
  • Recharts - Charting library
  • Plotly.js - Scientific plotting
  • React Router - Navigation
  • Bootstrap - CSS framework

Data Sources

  • SEC EDGAR API - Financial statements
  • Yahoo Finance - Stock prices and indices
  • FRED - Economic indicators
  • Alpha Vantage - Additional market data

πŸ“ Project Structure

financial_data_tool/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py              # FastAPI application
β”‚   β”‚   β”œβ”€β”€ data.py              # Financial data endpoints
β”‚   β”‚   β”œβ”€β”€ ai_endpoints.py      # AI/ML model endpoints
β”‚   β”‚   β”œβ”€β”€ macro_endpoints.py   # Economic data endpoints
β”‚   β”‚   └── data_collection_service.py
β”‚   └── api/
β”‚       └── cached_statements/   # JSON cache storage
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ FinancialTable.js
β”‚   β”‚   β”‚   β”œβ”€β”€ ChartManager.js
β”‚   β”‚   β”‚   β”œβ”€β”€ AIView.js
β”‚   β”‚   β”‚   β”œβ”€β”€ MacroView.js
β”‚   β”‚   β”‚   └── DraggableResizablePanel.js
β”‚   β”‚   └── App.js
β”‚   └── public/
β”œβ”€β”€ data-collection/
β”‚   └── scripts/
β”‚       β”œβ”€β”€ main.py              # Data collection entry point
β”‚       β”œβ”€β”€ Company.py
β”‚       β”œβ”€β”€ Filling.py
β”‚       └── FinancialStatement.py
β”œβ”€β”€ AI_ML/
β”‚   β”œβ”€β”€ AI/
β”‚   β”‚   └── stock_forecaster.py  # LSTM implementation
β”‚   └── Macro/
β”‚       └── macro_data.py         # Economic data fetchers
β”œβ”€β”€ GIFs/                         # Demo GIFs (TO BE ADDED)
β”œβ”€β”€ images/                       # Documentation images (TO BE ADDED)
└── README.md

πŸ”§ Configuration

Environment Variables

Create a .env file in the backend directory:

# API Keys (if needed)
ALPHA_VANTAGE_KEY=your_key_here
FRED_API_KEY=your_key_here

# Server Configuration
HOST=0.0.0.0
PORT=8000

Caching Configuration

By default, CSV files are cleaned up after JSON caching. To disable this:

# In data_collection_service.py
cleanup_csv=False  # Set to False to keep CSV files

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors