A comprehensive, full-stack application for analyzing financial statements from PDF reports. This intelligent system combines advanced PDF parsing, financial data extraction, and interactive visualization with real-time progress tracking and semantic search capabilities.
- Multi-format Support: Process both text-based and scanned PDFs with OCR
- Real-time Progress Tracking: Live progress bar (0-100%) with detailed status updates
- Batch Processing: Handle multiple financial documents simultaneously
- Error Recovery: Robust parsing with graceful handling of complex PDF structures
- Comprehensive Data Extraction: Income statements, balance sheets, cash flow statements
- Financial Ratio Calculation: Automated computation of key financial ratios and metrics
- Multi-year Trend Analysis: Visualize financial performance over time
- Quality Assurance: Automated data validation and consistency checks
- Modern UI: Clean, responsive interface built with React and TypeScript
- Dark/Light Mode: Toggle between themes for comfortable viewing
- Dynamic Visualizations: Interactive charts and graphs for financial trends
- Company Selection: Easy navigation between multiple companies and years
- AI-Powered Search: Find specific information in financial notes and MD&A sections
- Vector Embeddings: Advanced text similarity search using sentence transformers
- Context-Aware Results: Intelligent ranking of search results by relevance
- Automated QA Checks: Built-in validation for financial data consistency
- Error Detection: Identify missing data, calculation errors, and anomalies
- Data Normalization: Standardize financial data across different reporting formats
# Clone the repository
git clone https://github.com/sujal-pawar/Financial_statement_analysis.git
cd Financial_statement_analysis
# Run the automated setup script
run_app.batThe script will automatically:
- ✅ Create Python virtual environment
- ✅ Install all dependencies (Python + Node.js)
- ✅ Start backend server on
http://localhost:5000 - ✅ Start frontend server on
http://localhost:5173 - ✅ Open application in your browser
# 1. Clone repository
git clone https://github.com/sujal-pawar/Financial_statement_analysis.git
cd Financial_statement_analysis
# 2. Create virtual environment
python -m venv venv
# 3. Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# 4. Install Python dependencies
pip install -r requirements.txt# 1. Navigate to client directory
cd client
# 2. Install Node.js dependencies
npm install
# 3. Start development server
npm run dev# In the main project directory
python server.py- OS: Windows 10, macOS 10.14, or Ubuntu 18.04+
- RAM: 4 GB (8 GB recommended for large PDFs)
- Storage: 2 GB free space
- Internet: Required for initial dependency installation
- OS: Windows 11, macOS 12+, or Ubuntu 20.04+
- RAM: 8 GB or more
- CPU: Multi-core processor for faster PDF processing
- Storage: SSD for better performance
- Open the application at
http://localhost:5173 - Click "Browse files" or drag-and-drop PDF files
- Watch real-time progress with detailed status updates:
- 📄 File upload (0-10%)
- 🔍 PDF parsing (10-45%)
- 📊 Data extraction (45-75%)
- ✅ Analysis completion (75-100%)
- Select a company from the dropdown menu
- Choose a year to analyze
- Navigate through tabs:
- 📈 Overview: Key financial metrics and summary
- 📊 Financial Trends: Multi-year comparison charts
⚠️ QA Findings: Data quality issues and recommendations- 🤖 Chatbot Assistant: AI-powered financial insights
- Use semantic search to find specific information
- Compare financial ratios across different periods
- Export data for further analysis
- Review QA findings for data validation
- SEC 10-K Filings: Complete annual reports
- Annual Reports: Corporate annual financial reports
- Quarterly Reports (10-Q): Interim financial statements
- Proxy Statements: When containing financial data
- Financial Statements: Standalone income statements, balance sheets, cash flow statements
- Scanned PDFs: Processed with OCR (may have lower accuracy)
- Non-standard Formats: Custom financial report layouts
- International Reports: Non-US GAAP reporting standards
- Encrypted/Secured PDFs: Password-protected documents
- Image-only Files: Pure image files without text layer
- Non-financial Documents: General business documents without financial data
For optimal results, PDFs should contain:
- Tabular financial data with clear row/column structure
- Standard financial statement labels (Revenue, Assets, Liabilities, etc.)
- Numerical data in recognizable formats ($, thousands, millions)
- Company identification information
- Year/period indicators
Try these types of documents for best results:
- Apple Inc. 10-K - Clean, well-structured format
- Microsoft Annual Report - Standard corporate reporting
- Amazon 10-Q - Quarterly financial statements
- Google (Alphabet) 10-K - Technology sector example
Download Examples: Visit SEC EDGAR database at sec.gov/edgar for official filings.
# Backend Configuration
FLASK_ENV=development
UPLOAD_FOLDER=data/pdfs
OUTPUT_FOLDER=data/output
EMBEDDINGS_FOLDER=data/embeddings
# Frontend Configuration
VITE_API_URL=http://localhost:5000
VITE_APP_TITLE=Financial Analysis Dashboard# In server.py - Modify PDF parsing engine
parser_engine = 'pymupdf' # Options: 'pymupdf', 'tesseract', 'tika'// In client/src/App.tsx - Modify theme settings
const defaultTheme = 'light'; // Options: 'light', 'dark', 'auto'Symptoms: Empty dropdown, no data after upload Solutions:
- ✅ Check if PDF contains recognizable financial tables
- ✅ Verify file is not encrypted/password-protected
- ✅ Try a standard SEC filing (10-K) for testing
- ✅ Check browser console for detailed error messages
Symptoms: Progress bar stops updating, no completion Solutions:
- ✅ Check backend server logs for processing errors
- ✅ Ensure sufficient RAM for large PDF files
- ✅ Verify network connection for real-time updates
- ✅ Refresh page and retry upload
Symptoms: Connection refused, server startup errors Solutions:
# Check port availability
netstat -an | grep :5000
# Verify Python environment
python --version # Should be 3.10+
# Reinstall dependencies
pip install -r requirements.txt --force-reinstall
# Check detailed logs
tail -f api.logSymptoms: White screen, compilation errors Solutions:
# Clear cache and reinstall
cd client
rm -rf node_modules package-lock.json
npm install
# Check Node.js version
node --version # Should be 18+
# Run development server
npm run devSymptoms: "Failed to process file" errors Solutions:
- ✅ Ensure PDF is not corrupted (
pdf can be opened manually) - ✅ Try different parser engine in configuration
- ✅ Check PDF has selectable text (not pure image)
- ✅ Verify sufficient disk space for temporary files
Symptoms: No search results, embeddings errors Solutions:
- ✅ Ensure PyTorch is properly installed
- ✅ Check internet connection for model downloads
- ✅ Verify sufficient RAM for embedding models
- ✅ Check embeddings folder permissions
- API Logs:
api.log- Backend server activities - Pipeline Logs:
pipeline.log- PDF processing details - Browser Console: F12 → Console - Frontend errors
- Network Tab: F12 → Network - API communication issues
# Enable verbose logging
export FLASK_ENV=development
export LOG_LEVEL=DEBUG
# Run with debug output
python server.py --debug- Framework: Flask (Python web framework)
- PDF Processing: PyMuPDF, Tesseract OCR, Apache Tika
- Data Analysis: Pandas, NumPy for financial calculations
- AI/ML: Sentence Transformers, FAISS for semantic search
- Database: JSON-based storage with CSV exports
- Framework: React 18 with TypeScript
- Build Tool: Vite for fast development and building
- Styling: Tailwind CSS for responsive design
- Icons: Lucide React for modern iconography
- State Management: React Context API
Financial_statement_analysis/
├── 📁 client/ # Frontend React application
│ ├── 📁 src/
│ │ ├── 📁 components/ # Reusable UI components
│ │ ├── 📁 context/ # State management
│ │ ├── 📁 services/ # API communication
│ │ └── 📁 types/ # TypeScript definitions
│ ├── 📄 package.json # Node.js dependencies
│ └── 📄 vite.config.ts # Build configuration
├── 📁 data/ # Data storage directory
│ ├── 📁 pdfs/ # Uploaded PDF files
│ ├── 📁 output/ # Processed financial data
│ └── 📁 embeddings/ # AI search embeddings
├── 📁 npnonlyf/ # Backend processing modules
│ ├── 📄 pdf_parser.py # PDF extraction logic
│ ├── 📄 pipeline.py # Main processing pipeline
│ ├── 📄 embeddings.py # Semantic search engine
│ ├── 📄 qa_checks.py # Data validation
│ └── 📄 requirements.txt # Python dependencies
├── 📄 server.py # Flask API server
├── 📄 run_app.bat # Automated setup script
└── 📄 README.md # This documentation
- Upload: PDF files uploaded via REST API
- Processing: Background pipeline extracts financial data
- Storage: Structured data saved as CSV and JSON
- Analysis: Financial ratios and trends calculated
- Search: Text embeddings created for semantic search
- Visualization: Frontend displays interactive charts
- File Validation: Only PDF files accepted
- Size Limits: Configurable upload size restrictions
- CORS Protection: Proper cross-origin request handling
- Input Sanitization: All user inputs validated and sanitized
We welcome contributions! Please follow these guidelines:
- Check existing issues first
- Provide detailed error messages and logs
- Include system information and steps to reproduce
- Attach sample PDF files (if not confidential)
- Describe the use case and benefits
- Provide implementation suggestions
- Consider backward compatibility
- Include mockups or examples if applicable
# Fork the repository
git fork https://github.com/sujal-pawar/Financial_statement_analysis.git
# Clone your fork
git clone https://github.com/YOUR_USERNAME/Financial_statement_analysis.git
# Create feature branch
git checkout -b feature/your-feature-name
# Install development dependencies
pip install -r requirements-dev.txt
npm install --include=dev
# Make changes and test
python -m pytest tests/
npm test
# Submit pull request
git push origin feature/your-feature-nameThis project is licensed under the MIT License - see the LICENSE file for details.
- PyMuPDF for excellent PDF processing capabilities
- React Community for comprehensive frontend ecosystem
- Hugging Face for pre-trained transformer models
- Tailwind CSS for utility-first styling approach
- SEC EDGAR for publicly available financial data
- GitHub Issues: Report bugs or request features
- Documentation: Check this README and inline code comments
- Community: Join discussions in GitHub Discussions
Made with ❤️ for financial analysis and transparency