Professional Banking Tool for Syndicated Loan Operations
LoanGuard is a Streamlit-based web application that validates syndicated loan interest calculations by extracting data from PDF notices and comparing calculated values against reported amounts. Built for loan agents to prevent calculation errors before notices are sent to lenders.
- 📄 PDF Data Extraction: Automatically extracts financial data from Interest Payment Notice PDFs
- 🧮 Banking-Grade Calculations: Uses standard 360-day banking convention for interest calculations
- ✅ Smart Validation: Compares calculated vs. notice amounts with appropriate tolerance
- 🎨 Professional UI: Clean, banker-style interface with clear pass/fail indicators
- 🔒 Error Handling: Comprehensive validation and user-friendly error messages
- 📊 Detailed Reports: Professional comparison tables and calculation breakdowns
- Python 3.8+
- pip package manager
-
Clone the repository
git clone https://github.com/kp183/syndiclean.git cd syndiclean -
Install dependencies
pip install -r requirements.txt
-
Run the application
streamlit run app.py
-
Open your browser
- Navigate to
http://localhost:8501 - Upload a PDF interest payment notice
- Watch LoanGuard validate the calculations!
- Navigate to
- Drag and drop or select PDF files up to 50MB
- Supports standard Interest Payment Notice formats
- Principal Amount: Loan amount in dollars
- Interest Rate: Annual percentage rate
- Date Range: Interest calculation period
- Notice Amount: Interest amount from the PDF
Interest = Principal × Rate × Days / 360
Uses standard banking day-count convention
- ✅ PASS: Green card when amounts match within tolerance
- ❌ FAIL: Red card when difference exceeds acceptable limits
- 📊 Detailed Analysis: Shows exact differences and recommendations
syndiclean/
├── 📄 app.py # Main Streamlit application
├── 📄 extractor.py # PDF data extraction engine
├── 📄 calculator.py # Interest calculation formulas
├── 📄 validator.py # Validation logic and comparison
├── 📄 input_validator.py # Input validation and error handling
├── 📄 logging_config.py # Structured logging configuration
├── 📄 requirements.txt # Python dependencies
├── 📁 .streamlit/ # Streamlit configuration
├── 📄 sample_correct_interest_notice.pdf # Demo file (PASS)
├── 📄 sample_incorrect_interest_notice.pdf # Demo file (FAIL)
└── 📁 tests/ # Test files
Run the included tests to verify functionality:
# Run all tests
python -m pytest
# Run specific tests
python -m pytest test_app.py
python -m pytest test_calculator.py
python -m pytest test_extractor.py
python -m pytest test_validator.pyTry the included sample PDFs:
sample_correct_interest_notice.pdf- Shows ✅ PASS validationsample_incorrect_interest_notice.pdf- Shows ❌ FAIL validation
Located in .streamlit/config.toml:
- Professional banking theme
- Security settings
- Upload limits and server configuration
- Tolerance Calculation: $1 or 0.01% (whichever is larger)
- 360-Day Convention: Standard banking day count
- Currency Formatting: Professional financial display
- Error Recovery: Graceful handling of malformed PDFs
- Clean, professional design suitable for banking executives
- Large visual indicators for quick decision making
- Banking-appropriate language and recommendations
- "Final pre-send validation before lender notification"
streamlit run app.pySee DEPLOYMENT.md for comprehensive deployment instructions including:
- Docker deployment
- Streamlit Cloud deployment
- Production server setup
- Security considerations
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Streamlit - Web application framework
- pdfplumber - PDF text extraction
- pandas - Data manipulation
- pytest - Testing framework
LoanGuard v1.0 - Professional Banking Tool for Interest Validation
Syndicated Loan Operations • Production-Ready • Secure Processing