You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DocuSwitch — Pluggable document conversion for Python
One API. Multiple document engines. Switch converters without changing your application.
1. Overview
Modern document-processing libraries are highly specialized.
Some are optimized for:
⚡ speed
📄 PDF parsing
🔍 OCR
📊 table extraction
🧮 formula recognition
🧱 layout understanding
🤖 RAG pipelines
🌍 multilingual documents
But integrating multiple engines into one application is difficult because every library exposes a different API, configuration model, output format, and dependency stack.
DocuSwitch provides a common Python interface over multiple document conversion engines.
The router analyzes the document and chooses the appropriate engine.
Example:
document.pdf
│
▼
┌───────────────┐
│ Document │
│ Analyzer │
└───────┬───────┘
│
┌───────────┼───────────┐
│ │ │
▼ ▼ ▼
Native Scanned Complex
PDF PDF PDF
│ │ │
▼ ▼ ▼
PDF Inspector PaddleOCR MinerU
A future routing strategy could consider:
file type
file size
page count
OCR requirement
table density
formula density
language
layout complexity
available GPU
latency requirement
quality requirement
7. Converter Profiles
Instead of selecting a specific engine, users can select a profile.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Project Documentation
Project Name
DocuSwitch — Pluggable document conversion for Python
1. Overview
Modern document-processing libraries are highly specialized.
Some are optimized for:
But integrating multiple engines into one application is difficult because every library exposes a different API, configuration model, output format, and dependency stack.
DocuSwitch provides a common Python interface over multiple document conversion engines.
Your application doesn't need to know which engine is underneath.
2. Goals
Primary goals
Non-goals
DocuSwitch should not initially try to:
It should remain an orchestration and abstraction layer.
3. Supported Engines
Initial adapters:
The project should treat these as plugins, not hard dependencies.
4. Architecture
5. Core API
The main API should be deliberately small.
Switching engines:
No application code needs to change.
6. Automatic Routing
The most powerful feature should be:
The router analyzes the document and chooses the appropriate engine.
Example:
A future routing strategy could consider:
7. Converter Profiles
Instead of selecting a specific engine, users can select a profile.
Fast
Possible routing:
Quality
Possible routing:
OCR
Auto
8. Unified Result
Every engine should return a common structure.
Example:
The underlying engine can still expose native output through:
This is important because you don't want your abstraction to become a lowest-common-denominator API.
9. Capability System
Every adapter declares what it supports.
Example:
This enables:
The router can then select an appropriate engine.
10. Fallback
Converters can fail.
For production systems, the library should support fallback chains.
Execution:
The result should record this:
11. Performance Benchmarking
DocuSwitch should provide a standard benchmark interface.
Example:
Importantly, quality scores should be dataset-specific, rather than claiming that one parser is universally better.
12. Metrics
Every conversion should optionally collect:
This makes it possible to answer:
13. Optional Dependencies
This is critical.
Don't make users install every parser.
For example:
Core only.
Then:
Or:
This keeps the base installation lightweight.
14. Plugin Architecture
Eventually, third-party developers should be able to create:
Then register:
Long term, support Python entry points:
Then DocuSwitch can discover converters automatically.
15. CLI
The project should also provide a CLI.
Convert
Specific converter
Automatic
Profile
List available converters
Output:
16. Project Structure
17. Roadmap
Phase 1 — Core
ConverterinterfaceConversionResultPhase 2 — Adapters
Phase 3 — Intelligence
Phase 4 — Observability
Phase 5 — Production
Phase 6 — Ecosystem
18. Future Architecture
Eventually this can evolve from a simple Python wrapper into:
19. Why This Project?
The ecosystem has many excellent document-processing engines, but applications often become tightly coupled to one implementation.
For example:
Later you discover:
Now changing the parser requires modifying application code.
With DocuSwitch:
The application remains unchanged.
This makes the parser an implementation detail.
20. Key Design Principle
The project should follow this rule:
Each engine should remain free to expose its unique capabilities.
The abstraction should provide:
Recommended MVP
I wouldn't start with all eight adapters.
Start with:
v0.1
Then add:
v0.2
Then build the feature that can make the project genuinely differentiated:
That is what turns it from "a wrapper around existing libraries" into a useful infrastructure project.
All reactions