{"id":34107949,"url":"https://github.com/madeinoz67/bank-statement-separator","last_synced_at":"2026-04-02T01:01:24.450Z","repository":{"id":316861665,"uuid":"1052082900","full_name":"madeinoz67/bank-statement-separator","owner":"madeinoz67","description":"An AI-powered tool that automatically processes PDF files containing multiple bank statements and separates them into individual files. Built with LangChain and LangGraph for robust stateful AI processing.","archived":false,"fork":false,"pushed_at":"2025-09-11T14:07:12.000Z","size":6120,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-02T22:51:41.749Z","etag":null,"topics":["agentic-workflow","finance","lanchain","langraph"],"latest_commit_sha":null,"homepage":"https://madeinoz67.github.io/bank-statement-separator/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madeinoz67.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-07T11:20:13.000Z","updated_at":"2025-09-11T14:01:15.000Z","dependencies_parsed_at":"2025-09-27T07:26:24.820Z","dependency_job_id":null,"html_url":"https://github.com/madeinoz67/bank-statement-separator","commit_stats":null,"previous_names":["madeinoz67/bank-statement-separator"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/madeinoz67/bank-statement-separator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeinoz67%2Fbank-statement-separator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeinoz67%2Fbank-statement-separator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeinoz67%2Fbank-statement-separator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeinoz67%2Fbank-statement-separator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madeinoz67","download_url":"https://codeload.github.com/madeinoz67/bank-statement-separator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeinoz67%2Fbank-statement-separator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-workflow","finance","lanchain","langraph"],"created_at":"2025-12-14T18:11:24.674Z","updated_at":"2026-04-02T01:01:24.404Z","avatar_url":"https://github.com/madeinoz67.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bank Statement Separator\n\n[![Documentation](https://img.shields.io/badge/docs-online-blue)](https://madeinoz67.github.io/bank-statement-separator/)\n[![Tests](https://img.shields.io/badge/tests-37%2F37%20passing-brightgreen)](https://github.com/madeinoz67/bank-statement-separator/actions)\n[![PyPI](https://img.shields.io/pypi/v/bank-statement-separator)](https://pypi.org/project/bank-statement-separator/)\n[![Python](https://img.shields.io/pypi/pyversions/bank-statement-separator)](https://pypi.org/project/bank-statement-separator/)\n[![Release](https://img.shields.io/badge/version-v0.3.0-blue)](https://github.com/madeinoz67/bank-statement-separator/releases/tag/v0.3.0)\n\nAn AI-powered tool that automatically processes PDF files containing multiple bank statements and separates them into individual files. Built with LangChain and LangGraph for robust stateful AI processing.\n\n## 🚀 Features\n\n- **AI-Powered Analysis**: Uses advanced language models to detect statement boundaries\n- **Multiple LLM Support**: Compatible with OpenAI GPT models and Ollama local models\n- **PDF Processing**: Efficient document manipulation using PyMuPDF\n- **Metadata Extraction**: Automatically extracts account numbers, dates, and bank information\n- **File Organization**: Generates meaningful filenames following configurable patterns\n- **Error Handling**: Comprehensive logging and audit trails\n- **Error Detection \u0026 Tagging**: Automatic identification and tagging of processing issues (v0.3.0+)\n- **Security Controls**: Built-in safeguards for production use\n- **Paperless Integration**: Optional integration with Paperless-ngx for document management\n\n## 📋 Requirements\n\n- Python 3.11+\n- OpenAI API key (for LLM functionality)\n- UV package manager\n- Optional: Paperless-ngx instance (for document management and error tagging)\n\n## 🛠 Installation\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/madeinoz67/bank-statement-separator.git\ncd bank-statement-separator\n```\n\n### 2. Install Dependencies\n\n```bash\n# Install with UV\nuv sync\n\n# Install with dev dependencies\nuv sync --group dev\n```\n\n### 3. Configure Environment\n\nCopy the example environment file and configure your settings:\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env` to set your OpenAI API key:\n\n```bash\nOPENAI_API_KEY=your_api_key_here\n```\n\n## 📖 Usage\n\n### Basic Usage\n\n```bash\n# Process a single PDF file\nuv run python -m src.bank_statement_separator.main input.pdf\n\n# Specify output directory\nuv run python -m src.bank_statement_separator.main input.pdf -o ./output\n\n# Use verbose logging\nuv run python -m src.bank_statement_separator.main input.pdf --verbose\n\n# Dry run mode (no files written)\nuv run python -m src.bank_statement_separator.main input.pdf --dry-run\n```\n\n### Advanced Options\n\n```bash\n# Specify LLM model\nuv run python -m src.bank_statement_separator.main input.pdf --model gpt-4o\n\n# Set custom processing limits\nuv run python -m src.bank_statement_separator.main input.pdf --max-pages 50\n\n# Enable debug mode\nuv run python -m src.bank_statement_separator.main input.pdf --debug\n```\n\n### Configuration\n\nThe application uses environment variables for configuration. Key settings include:\n\n- `OPENAI_API_KEY`: Your OpenAI API key\n- `OLLAMA_BASE_URL`: Ollama server URL (for local models)\n- `LOG_LEVEL`: Logging verbosity (DEBUG, INFO, WARNING, ERROR)\n- `MAX_PAGES_PER_STATEMENT`: Processing limits\n- `OUTPUT_DIR`: Default output directory\n\n### Error Detection Configuration (v0.3.0+)\n\n```bash\n# Enable error detection and tagging\nPAPERLESS_ERROR_DETECTION_ENABLED=true\nPAPERLESS_ERROR_TAGS=\"error:processing,needs:review\"\nPAPERLESS_ERROR_SEVERITY_LEVELS=\"medium,high,critical\"\n```\n\nSee [Configuration Guide](docs/getting-started/configuration.md) for complete details.\n\n## 🏗 Architecture\n\nThe system consists of several key components:\n\n- **Workflow Engine**: LangGraph-based state machine for processing steps\n- **LLM Analyzer**: AI-powered boundary detection and metadata extraction\n- **PDF Processor**: Document manipulation and text extraction\n- **Error Handler**: Comprehensive error management and recovery\n- **Error Detection System**: Automatic identification and tagging of processing issues (v0.3.0+)\n- **Rate Limiter**: API usage controls and backoff mechanisms\n\n### Processing Pipeline\n\n1. **PDF Ingestion**: Load and validate input documents\n2. **Document Analysis**: Extract text and structural information\n3. **Statement Detection**: AI boundary detection using LLM analysis\n4. **Metadata Extraction**: Account and period information extraction\n5. **PDF Generation**: Create individual statement files\n6. **File Organization**: Apply naming conventions and organization\n7. **Paperless Upload**: Optional document management integration\n8. **Error Detection**: Automatic identification and tagging of processing issues (v0.3.0+)\n\n## 🧪 Testing\n\n```bash\n# Run all tests\nuv run pytest\n\n# Run with coverage\nuv run pytest --cov=src\n\n# Run specific test categories\nuv run pytest tests/unit/\nuv run pytest tests/integration/\n\n# Test error detection and tagging (v0.3.0+)\nuv run pytest tests/unit/test_error_tagging*.py -v\nuv run python tests/manual/test_error_tagging_e2e.py\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Please follow these guidelines:\n\n### Development Setup\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/your-feature`\n3. Install development dependencies: `uv sync --group dev`\n4. Make your changes\n5. Run tests: `uv run pytest`\n6. Format code: `uv run ruff format .`\n7. Check linting: `uv run ruff check .`\n8. Commit your changes with a descriptive message\n9. Push to your fork and create a pull request\n\n### Code Quality\n\n- Follow PEP 8 style guidelines\n- Use type hints for all function parameters and return values\n- Write comprehensive docstrings for public APIs\n- Add tests for new features and bug fixes\n- Keep functions focused and small\n- Use descriptive variable and function names\n\n### Pull Request Process\n\n1. Ensure all tests pass\n2. Update documentation if needed\n3. Add appropriate commit trailers (see below)\n4. Request review from maintainers\n\n### Commit Guidelines\n\nFor commits fixing bugs or adding features based on user reports:\n\n```bash\ngit commit --trailer \"Reported-by:\u003cname\u003e\"\n```\n\nFor commits related to a GitHub issue:\n\n```bash\ngit commit --trailer \"Github-Issue:#\u003cnumber\u003e\"\n```\n\n## 📚 Documentation\n\n📖 **[Read the full documentation online](https://madeinoz67.github.io/bank-statement-separator/)**\n\nComplete documentation is available in the `docs/` directory:\n\n- [Getting Started](docs/getting-started/)\n- [User Guide](docs/user-guide/)\n- [Developer Guide](docs/developer-guide/)\n- [API Reference](docs/reference/)\n- [Architecture](docs/architecture/)\n\nBuild documentation locally:\n\n```bash\nuv run mkdocs serve\n```\n\n## 🔍 Error Detection \u0026 Tagging (v0.3.0+)\n\nThe system includes comprehensive error detection that automatically identifies processing issues and applies configurable tags for manual review:\n\n### Error Categories\n\n- **LLM Analysis Failures**: API errors, model failures, fallback usage\n- **Boundary Detection Issues**: Low confidence boundaries, suspicious patterns\n- **PDF Processing Errors**: File corruption, access issues, format problems\n- **Metadata Extraction Failures**: Missing account data, date parsing issues\n- **Validation Failures**: Content validation, integrity checks\n- **File Output Issues**: Write failures, permissions, disk space\n\n### Error Detection Setup\n\n```bash\n# Basic error detection setup\nPAPERLESS_ERROR_DETECTION_ENABLED=true\nPAPERLESS_ERROR_TAGS=\"error:processing,needs:review\"\nPAPERLESS_ERROR_SEVERITY_LEVELS=\"medium,high,critical\"\n\n# Advanced configuration\nPAPERLESS_ERROR_TAG_THRESHOLD=0.7\nPAPERLESS_ERROR_BATCH_TAGGING=true\n```\n\nSee the [Paperless Integration Guide](docs/user-guide/paperless-integration.md) for complete configuration details.\n\n## 📦 Dependencies\n\n### Core Dependencies\n\n- `langchain`: LLM integration framework\n- `langgraph`: Stateful workflow orchestration\n- `pymupdf`: PDF processing\n- `pydantic`: Data validation\n- `rich`: Terminal formatting\n- `python-dotenv`: Environment management\n\n### Development Dependencies\n\n- `pytest`: Testing framework\n- `ruff`: Code formatting and linting\n- `pyright`: Type checking\n- `mkdocs`: Documentation generation\n\nSee `pyproject.toml` for complete dependency list.\n\n## 🔒 Security\n\n- API keys are managed through environment variables\n- Input validation on all user-provided data\n- Rate limiting for external API calls\n- Comprehensive logging for audit trails\n- No sensitive data stored in application logs\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Built with [LangChain](https://langchain.com/) and [LangGraph](https://langchain-ai.github.io/langgraph/)\n- PDF processing powered by [PyMuPDF](https://pymupdf.readthedocs.io/)\n- Inspired by the need for automated document processing in financial workflows\n\n## 🐛 Issues \u0026 Support\n\n- Report bugs via [GitHub Issues](https://github.com/madeinoz67/bank-statement-separator/issues)\n- Check [Troubleshooting Guide](docs/reference/troubleshooting.md) for common issues\n- Review [Known Issues](docs/known_issues/) for current limitations\n\n---\n\n**Note**: This tool requires an OpenAI API key for AI functionality. Falls back to pattern matching if LLM is unavailable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeinoz67%2Fbank-statement-separator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadeinoz67%2Fbank-statement-separator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeinoz67%2Fbank-statement-separator/lists"}