DocForge 🔨
Forge perfect documents from any format with precision, power, and simplicity.
DocForge is a comprehensive document processing toolkit built on proven implementations with a modern modular architecture. Born from real-world needs and battle-tested algorithms, DocForge transforms how you work with documents.
✨ Features
- 🔍 OCR Processing: Convert scanned PDFs to searchable documents with precision
- 🗜️ Smart Optimization: Reduce file sizes without compromising quality
- ⚙️ Batch Processing: Handle hundreds of documents efficiently
- 🔧 Document Analysis: Extract insights and metadata
- 🎯 Modular Design: Use only what you need, extend easily
🚀 Why DocForge?
- Battle-tested OCR algorithms with Windows compatibility
- Advanced optimization techniques from real-world usage
- Memory-efficient batch processing for large-scale operations
- Clean, modular codebase that's easy to understand and extend
- Comprehensive error handling and logging
- Both programmatic API and command-line interface
📦 Installation
Option 1: Install from PyPI (when available)
pip install docforge
Option 2: Install from source
git clone https://github.com/oscar2song/docforge.git
cd docforge
pip install -e .
System Dependencies
Ubuntu/Debian:
sudo apt-get install tesseract-ocr poppler-utils
macOS:
brew install tesseract poppler
Windows: Download Tesseract from: https://github.com/tesseract-ocr/tesseract
🎯 Quick Start
Command Line Interface
After installation, use the docforge command:
# Get help
docforge --help
# OCR a scanned PDF
docforge enhanced-ocr -i scanned_document.pdf -o searchable_document.pdf
# Batch OCR processing
docforge enhanced-batch-ocr -i scanned_folder/ -o searchable_folder/
# Standard OCR processing
docforge ocr -i document.pdf -o output.pdf --language eng
# Batch optimization
docforge batch-ocr -i input_folder/ -o output_folder/
# Test the interface
docforge test-rich
# Run performance benchmarks
docforge benchmark --test-files document.pdf
Programmatic API
from docforge import DocumentProcessor
# Initialize the processor
processor = DocumentProcessor(verbose=True)
# OCR a scanned PDF
result = processor.ocr_pdf(
"scanned_document.pdf",
"searchable_document.pdf",
language='eng'
)
# Optimize PDF size
result = processor.optimize_pdf(
"large_document.pdf",
"optimized_document.pdf",
optimization_type="aggressive"
)
# Batch processing
result = processor.batch_ocr_pdfs(
"scanned_folder/",
"searchable_folder/"
)
🏗️ Architecture
DocForge is built with a clean, modular architecture:
docforge/
├── core/ # Core processing engine
├── pdf/ # PDF operations (proven implementations)
├── cli/ # Command-line interface
├── utils/ # Shared utilities
└── main.py # CLI entry point
📋 Available Commands
| Command | Description |
|---|---|
enhanced-ocr |
OCR with advanced performance optimization |
enhanced-batch-ocr |
Batch OCR with intelligent performance optimization |
ocr |
Standard OCR processing |
batch-ocr |
Standard batch OCR processing |
optimize |
PDF optimization |
pdf-to-word |
PDF to Word conversion |
split-pdf |
Split PDF documents |
benchmark |
Run performance benchmarks |
perf-stats |
Display performance statistics |
test-rich |
Test Rich CLI interface |
🧪 Examples
Run the examples to see DocForge in action:
# Basic usage examples (if you have example files)
python examples/basic_usage.py
# Test the CLI interface
docforge test-rich
# Test error handling
docforge test-errors
# Test validation system
docforge test-validation
🤝 Contributing
We welcome contributions! The modular architecture makes it easy to add new features.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
🗺️ Roadmap
- ✅ Core PDF processing with proven implementations
- ✅ OCR and optimization capabilities
- ✅ Command-line interface
- ✅ Comprehensive documentation
- 📄 Word document processing (Word ↔ PDF conversion)
- 🎨 Modern GUI interface
- 🚀 Performance optimizations
- 📊 Excel and PowerPoint support
- 🤖 AI-powered document analysis
- 🌐 Web interface
📄 License
This project is licensed under the MIT License.
🏆 Acknowledgments
Built with proven implementations and enhanced with modern architecture for the open source community.
⭐ If DocForge helped you, please give it a star! ⭐
Built by craftsmen, for craftsmen. 🔨
Metadata
Release files for docforge 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docforge-0.1.0.tar.gz | 80.3 kB | Without provenance | Details for docforge-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| docforge-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for docforge-0.1.0-py3-none-any.whl |
Total release size: 163.5 kB
Release files / docforge-0.1.0.tar.gz
| Download URL | docforge-0.1.0.tar.gz |
|---|---|
| Size | 80.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36e6e2603953995b6c98ae23a1a4955ed4c231c5bbc19e5ae94a911175d2b40d
|
|
BLAKE2b-256 checksum How to use checksums |
a86e42ae2199b8df49765285aa752664b05042967b7a1ccd68a5aeb79b1d8e62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Release files / docforge-0.1.0-py3-none-any.whl
| Download URL | docforge-0.1.0-py3-none-any.whl |
|---|---|
| Size | 83.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28194596e3dac1ae07affd3e443f40bee3281ebcf4d179a1d737bd394333f8e1
|
|
BLAKE2b-256 checksum How to use checksums |
729c161b79acbd08c7fc7b82268dba7a79bbcbde8a5404291b2acdcbd2080f32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Security for docforge 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.