super-document-processor 0.1.3__tar.gz → 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/PKG-INFO +20 -11
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/README.md +18 -9
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/pyproject.toml +2 -2
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/super_document_processor.egg-info/PKG-INFO +20 -11
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/super_document_processor.egg-info/requires.txt +1 -1
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/vlm.py +9 -2
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/LICENSE +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/__init__.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_docx.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_images.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_msg.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_pdf.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_plain_text.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_pptx.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/main.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/processor.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/setup.cfg +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/super_document_processor.egg-info/SOURCES.txt +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/super_document_processor.egg-info/dependency_links.txt +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/super_document_processor.egg-info/entry_points.txt +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/super_document_processor.egg-info/top_level.txt +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/aspose_slide_renderer.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/chunker.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/docx_image_utils.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/docx_xml_parser.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/optimizer.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/pdf_image_utils.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/pdf_table_utils.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/pptx_components_extract.py +0 -0
- {super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/pptx_converter.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: super-document-processor
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: High-fidelity multi-format document parsing and chunking engine for RAG pipelines
|
|
5
5
|
Author: Cinderfox
|
|
6
6
|
License: MIT
|
|
@@ -26,7 +26,7 @@ Requires-Dist: python-docx==1.2.0
|
|
|
26
26
|
Requires-Dist: python-pptx==1.0.2
|
|
27
27
|
Requires-Dist: extract-msg==0.56.1
|
|
28
28
|
Requires-Dist: lxml==6.1.3
|
|
29
|
-
Requires-Dist: aspose-slides==26.
|
|
29
|
+
Requires-Dist: aspose-slides==26.8.0
|
|
30
30
|
Requires-Dist: python-dotenv==1.2.3
|
|
31
31
|
Requires-Dist: fastapi==0.141.1
|
|
32
32
|
Requires-Dist: uvicorn==0.52.4
|
|
@@ -58,24 +58,25 @@ Available as a **Python library**, **CLI tool**, and **FastAPI microservice** (w
|
|
|
58
58
|
|
|
59
59
|
## Quickstart
|
|
60
60
|
|
|
61
|
-
### 1.
|
|
61
|
+
### 1. Install via PyPI
|
|
62
|
+
```bash
|
|
63
|
+
pip install super-document-processor
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2. Or Local Clone
|
|
62
67
|
```bash
|
|
63
68
|
git clone https://github.com/Cinderfox/Super-Document-Processor.git
|
|
64
69
|
cd Super-Document-Processor
|
|
65
70
|
|
|
66
|
-
# Setup environment
|
|
67
71
|
python -m venv .venv
|
|
68
72
|
source .venv/bin/activate # On Windows: .\.venv\Scripts\activate
|
|
69
73
|
pip install -r requirements.txt
|
|
70
|
-
|
|
71
|
-
# Configure environment (optional, required only for Vision LLMs)
|
|
72
74
|
cp .env.example .env
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
###
|
|
77
|
+
### 3. Docker
|
|
76
78
|
```bash
|
|
77
|
-
docker
|
|
78
|
-
docker run -d --name doc-processor -p 8000:8000 -v ${PWD}/data:/data super-document-processor:latest
|
|
79
|
+
docker run -d --name doc-processor -p 8000:8000 -v ${PWD}/data:/data cinderfox/super-document-processor:latest
|
|
79
80
|
```
|
|
80
81
|
|
|
81
82
|
---
|
|
@@ -132,7 +133,7 @@ collector.clear()
|
|
|
132
133
|
Export PowerPoint slides directly to SVGs or PNGs:
|
|
133
134
|
|
|
134
135
|
```python
|
|
135
|
-
from
|
|
136
|
+
from super_document_processor import convert_pptx, create_pptx_render_zip
|
|
136
137
|
|
|
137
138
|
# 1. Convert all slides to SVGs (returns list of clean SVG strings)
|
|
138
139
|
res = convert_pptx("presentation.pptx", format="svg")
|
|
@@ -254,6 +255,12 @@ curl -X POST "http://localhost:8000/convert/pptx?format=png&as_zip=true" \
|
|
|
254
255
|
|
|
255
256
|
#### Convert Mounted Volume Path via JSON Body
|
|
256
257
|
```bash
|
|
258
|
+
# Convert specific slide to PNG
|
|
259
|
+
curl -X POST "http://localhost:8000/convert/pptx" \
|
|
260
|
+
-H "Content-Type: application/json" \
|
|
261
|
+
-d '{"file_path": "/data/presentation.pptx", "slide": 1, "format": "png"}' -o slide_1.png
|
|
262
|
+
|
|
263
|
+
# Convert all slides to SVG
|
|
257
264
|
curl -X POST "http://localhost:8000/convert/pptx" \
|
|
258
265
|
-H "Content-Type: application/json" \
|
|
259
266
|
-d '{"file_path": "/data/presentation.pptx", "format": "svg"}'
|
|
@@ -365,9 +372,11 @@ docker compose up -d
|
|
|
365
372
|
|
|
366
373
|
| Variable | Default | Description |
|
|
367
374
|
|---|---|---|
|
|
375
|
+
| `MAX_WORKERS` | `3` | Max concurrent worker threads for slide rendering, image extraction, and VLM calls |
|
|
368
376
|
| `PORT` | `8000` | HTTP port when running in server mode |
|
|
377
|
+
| `JOBS_DIR` | `/data/jobs` (or `./data/jobs`) | Storage directory for asynchronous background job results |
|
|
369
378
|
| `OPENAI_API_KEY` | *None* | API key for Vision LLM extraction |
|
|
370
|
-
| `OPENAI_BASE_URL` | `https://api.openai.com/v1
|
|
379
|
+
| `OPENAI_BASE_URL` | *None* | Gateway URL (e.g. `https://api.openai.com/v1`, LiteLLM, Ollama, etc.) |
|
|
371
380
|
|
|
372
381
|
---
|
|
373
382
|
|
|
@@ -20,24 +20,25 @@ Available as a **Python library**, **CLI tool**, and **FastAPI microservice** (w
|
|
|
20
20
|
|
|
21
21
|
## Quickstart
|
|
22
22
|
|
|
23
|
-
### 1.
|
|
23
|
+
### 1. Install via PyPI
|
|
24
|
+
```bash
|
|
25
|
+
pip install super-document-processor
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 2. Or Local Clone
|
|
24
29
|
```bash
|
|
25
30
|
git clone https://github.com/Cinderfox/Super-Document-Processor.git
|
|
26
31
|
cd Super-Document-Processor
|
|
27
32
|
|
|
28
|
-
# Setup environment
|
|
29
33
|
python -m venv .venv
|
|
30
34
|
source .venv/bin/activate # On Windows: .\.venv\Scripts\activate
|
|
31
35
|
pip install -r requirements.txt
|
|
32
|
-
|
|
33
|
-
# Configure environment (optional, required only for Vision LLMs)
|
|
34
36
|
cp .env.example .env
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
###
|
|
39
|
+
### 3. Docker
|
|
38
40
|
```bash
|
|
39
|
-
docker
|
|
40
|
-
docker run -d --name doc-processor -p 8000:8000 -v ${PWD}/data:/data super-document-processor:latest
|
|
41
|
+
docker run -d --name doc-processor -p 8000:8000 -v ${PWD}/data:/data cinderfox/super-document-processor:latest
|
|
41
42
|
```
|
|
42
43
|
|
|
43
44
|
---
|
|
@@ -94,7 +95,7 @@ collector.clear()
|
|
|
94
95
|
Export PowerPoint slides directly to SVGs or PNGs:
|
|
95
96
|
|
|
96
97
|
```python
|
|
97
|
-
from
|
|
98
|
+
from super_document_processor import convert_pptx, create_pptx_render_zip
|
|
98
99
|
|
|
99
100
|
# 1. Convert all slides to SVGs (returns list of clean SVG strings)
|
|
100
101
|
res = convert_pptx("presentation.pptx", format="svg")
|
|
@@ -216,6 +217,12 @@ curl -X POST "http://localhost:8000/convert/pptx?format=png&as_zip=true" \
|
|
|
216
217
|
|
|
217
218
|
#### Convert Mounted Volume Path via JSON Body
|
|
218
219
|
```bash
|
|
220
|
+
# Convert specific slide to PNG
|
|
221
|
+
curl -X POST "http://localhost:8000/convert/pptx" \
|
|
222
|
+
-H "Content-Type: application/json" \
|
|
223
|
+
-d '{"file_path": "/data/presentation.pptx", "slide": 1, "format": "png"}' -o slide_1.png
|
|
224
|
+
|
|
225
|
+
# Convert all slides to SVG
|
|
219
226
|
curl -X POST "http://localhost:8000/convert/pptx" \
|
|
220
227
|
-H "Content-Type: application/json" \
|
|
221
228
|
-d '{"file_path": "/data/presentation.pptx", "format": "svg"}'
|
|
@@ -327,9 +334,11 @@ docker compose up -d
|
|
|
327
334
|
|
|
328
335
|
| Variable | Default | Description |
|
|
329
336
|
|---|---|---|
|
|
337
|
+
| `MAX_WORKERS` | `3` | Max concurrent worker threads for slide rendering, image extraction, and VLM calls |
|
|
330
338
|
| `PORT` | `8000` | HTTP port when running in server mode |
|
|
339
|
+
| `JOBS_DIR` | `/data/jobs` (or `./data/jobs`) | Storage directory for asynchronous background job results |
|
|
331
340
|
| `OPENAI_API_KEY` | *None* | API key for Vision LLM extraction |
|
|
332
|
-
| `OPENAI_BASE_URL` | `https://api.openai.com/v1
|
|
341
|
+
| `OPENAI_BASE_URL` | *None* | Gateway URL (e.g. `https://api.openai.com/v1`, LiteLLM, Ollama, etc.) |
|
|
333
342
|
|
|
334
343
|
---
|
|
335
344
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "super-document-processor"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
description = "High-fidelity multi-format document parsing and chunking engine for RAG pipelines"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -43,7 +43,7 @@ dependencies = [
|
|
|
43
43
|
"python-pptx==1.0.2",
|
|
44
44
|
"extract-msg==0.56.1",
|
|
45
45
|
"lxml==6.1.3",
|
|
46
|
-
"aspose-slides==26.
|
|
46
|
+
"aspose-slides==26.8.0",
|
|
47
47
|
"python-dotenv==1.2.3",
|
|
48
48
|
"fastapi==0.141.1",
|
|
49
49
|
"uvicorn==0.52.4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: super-document-processor
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: High-fidelity multi-format document parsing and chunking engine for RAG pipelines
|
|
5
5
|
Author: Cinderfox
|
|
6
6
|
License: MIT
|
|
@@ -26,7 +26,7 @@ Requires-Dist: python-docx==1.2.0
|
|
|
26
26
|
Requires-Dist: python-pptx==1.0.2
|
|
27
27
|
Requires-Dist: extract-msg==0.56.1
|
|
28
28
|
Requires-Dist: lxml==6.1.3
|
|
29
|
-
Requires-Dist: aspose-slides==26.
|
|
29
|
+
Requires-Dist: aspose-slides==26.8.0
|
|
30
30
|
Requires-Dist: python-dotenv==1.2.3
|
|
31
31
|
Requires-Dist: fastapi==0.141.1
|
|
32
32
|
Requires-Dist: uvicorn==0.52.4
|
|
@@ -58,24 +58,25 @@ Available as a **Python library**, **CLI tool**, and **FastAPI microservice** (w
|
|
|
58
58
|
|
|
59
59
|
## Quickstart
|
|
60
60
|
|
|
61
|
-
### 1.
|
|
61
|
+
### 1. Install via PyPI
|
|
62
|
+
```bash
|
|
63
|
+
pip install super-document-processor
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2. Or Local Clone
|
|
62
67
|
```bash
|
|
63
68
|
git clone https://github.com/Cinderfox/Super-Document-Processor.git
|
|
64
69
|
cd Super-Document-Processor
|
|
65
70
|
|
|
66
|
-
# Setup environment
|
|
67
71
|
python -m venv .venv
|
|
68
72
|
source .venv/bin/activate # On Windows: .\.venv\Scripts\activate
|
|
69
73
|
pip install -r requirements.txt
|
|
70
|
-
|
|
71
|
-
# Configure environment (optional, required only for Vision LLMs)
|
|
72
74
|
cp .env.example .env
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
###
|
|
77
|
+
### 3. Docker
|
|
76
78
|
```bash
|
|
77
|
-
docker
|
|
78
|
-
docker run -d --name doc-processor -p 8000:8000 -v ${PWD}/data:/data super-document-processor:latest
|
|
79
|
+
docker run -d --name doc-processor -p 8000:8000 -v ${PWD}/data:/data cinderfox/super-document-processor:latest
|
|
79
80
|
```
|
|
80
81
|
|
|
81
82
|
---
|
|
@@ -132,7 +133,7 @@ collector.clear()
|
|
|
132
133
|
Export PowerPoint slides directly to SVGs or PNGs:
|
|
133
134
|
|
|
134
135
|
```python
|
|
135
|
-
from
|
|
136
|
+
from super_document_processor import convert_pptx, create_pptx_render_zip
|
|
136
137
|
|
|
137
138
|
# 1. Convert all slides to SVGs (returns list of clean SVG strings)
|
|
138
139
|
res = convert_pptx("presentation.pptx", format="svg")
|
|
@@ -254,6 +255,12 @@ curl -X POST "http://localhost:8000/convert/pptx?format=png&as_zip=true" \
|
|
|
254
255
|
|
|
255
256
|
#### Convert Mounted Volume Path via JSON Body
|
|
256
257
|
```bash
|
|
258
|
+
# Convert specific slide to PNG
|
|
259
|
+
curl -X POST "http://localhost:8000/convert/pptx" \
|
|
260
|
+
-H "Content-Type: application/json" \
|
|
261
|
+
-d '{"file_path": "/data/presentation.pptx", "slide": 1, "format": "png"}' -o slide_1.png
|
|
262
|
+
|
|
263
|
+
# Convert all slides to SVG
|
|
257
264
|
curl -X POST "http://localhost:8000/convert/pptx" \
|
|
258
265
|
-H "Content-Type: application/json" \
|
|
259
266
|
-d '{"file_path": "/data/presentation.pptx", "format": "svg"}'
|
|
@@ -365,9 +372,11 @@ docker compose up -d
|
|
|
365
372
|
|
|
366
373
|
| Variable | Default | Description |
|
|
367
374
|
|---|---|---|
|
|
375
|
+
| `MAX_WORKERS` | `3` | Max concurrent worker threads for slide rendering, image extraction, and VLM calls |
|
|
368
376
|
| `PORT` | `8000` | HTTP port when running in server mode |
|
|
377
|
+
| `JOBS_DIR` | `/data/jobs` (or `./data/jobs`) | Storage directory for asynchronous background job results |
|
|
369
378
|
| `OPENAI_API_KEY` | *None* | API key for Vision LLM extraction |
|
|
370
|
-
| `OPENAI_BASE_URL` | `https://api.openai.com/v1
|
|
379
|
+
| `OPENAI_BASE_URL` | *None* | Gateway URL (e.g. `https://api.openai.com/v1`, LiteLLM, Ollama, etc.) |
|
|
371
380
|
|
|
372
381
|
---
|
|
373
382
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import base64
|
|
2
3
|
import json
|
|
3
4
|
import logging
|
|
@@ -61,8 +62,14 @@ def is_auth_error(error_msg: str) -> bool:
|
|
|
61
62
|
return any(indicator in err_lower for indicator in auth_indicators)
|
|
62
63
|
|
|
63
64
|
def generate_image_description(image_bytes, model=None, max_retries=3, retry_delay=2):
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
raw_base_url = os.getenv("OPENAI_BASE_URL") or OPENAI_BASE_URL
|
|
66
|
+
if not raw_base_url:
|
|
67
|
+
raise ValueError(
|
|
68
|
+
"Cannot process images: OPENAI_BASE_URL is not set in the environment.\n"
|
|
69
|
+
"Please set OPENAI_BASE_URL (e.g. 'https://api.openai.com/v1' or custom gateway) or disable image processing."
|
|
70
|
+
)
|
|
71
|
+
base_url = raw_base_url.rstrip("/")
|
|
72
|
+
api_key = os.getenv("OPENAI_API_KEY") or OPENAI_API_KEY
|
|
66
73
|
|
|
67
74
|
is_local = "localhost" in base_url or "127.0.0.1" in base_url
|
|
68
75
|
if not api_key and not is_local:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_msg.py
RENAMED
|
File without changes
|
{super_document_processor-0.1.3 → super_document_processor-0.1.5}/document_processors/process_pdf.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/aspose_slide_renderer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{super_document_processor-0.1.3 → super_document_processor-0.1.5}/utils/pptx_components_extract.py
RENAMED
|
File without changes
|
|
File without changes
|