super-document-processor 0.1.3__tar.gz → 0.1.4__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.
Files changed (30) hide show
  1. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/PKG-INFO +13 -10
  2. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/README.md +12 -9
  3. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/pyproject.toml +1 -1
  4. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/super_document_processor.egg-info/PKG-INFO +13 -10
  5. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/vlm.py +9 -2
  6. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/LICENSE +0 -0
  7. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/__init__.py +0 -0
  8. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/document_processors/process_docx.py +0 -0
  9. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/document_processors/process_images.py +0 -0
  10. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/document_processors/process_msg.py +0 -0
  11. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/document_processors/process_pdf.py +0 -0
  12. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/document_processors/process_plain_text.py +0 -0
  13. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/document_processors/process_pptx.py +0 -0
  14. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/main.py +0 -0
  15. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/processor.py +0 -0
  16. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/setup.cfg +0 -0
  17. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/super_document_processor.egg-info/SOURCES.txt +0 -0
  18. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/super_document_processor.egg-info/dependency_links.txt +0 -0
  19. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/super_document_processor.egg-info/entry_points.txt +0 -0
  20. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/super_document_processor.egg-info/requires.txt +0 -0
  21. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/super_document_processor.egg-info/top_level.txt +0 -0
  22. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/aspose_slide_renderer.py +0 -0
  23. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/chunker.py +0 -0
  24. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/docx_image_utils.py +0 -0
  25. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/docx_xml_parser.py +0 -0
  26. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/optimizer.py +0 -0
  27. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/pdf_image_utils.py +0 -0
  28. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/pdf_table_utils.py +0 -0
  29. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/utils/pptx_components_extract.py +0 -0
  30. {super_document_processor-0.1.3 → super_document_processor-0.1.4}/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
3
+ Version: 0.1.4
4
4
  Summary: High-fidelity multi-format document parsing and chunking engine for RAG pipelines
5
5
  Author: Cinderfox
6
6
  License: MIT
@@ -58,24 +58,25 @@ Available as a **Python library**, **CLI tool**, and **FastAPI microservice** (w
58
58
 
59
59
  ## Quickstart
60
60
 
61
- ### 1. Local Setup
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
- ### 2. Docker Setup
77
+ ### 3. Docker
76
78
  ```bash
77
- docker build -t super-document-processor:latest .
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 utils.pptx_converter import convert_pptx, create_pptx_render_zip
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")
@@ -365,9 +366,11 @@ docker compose up -d
365
366
 
366
367
  | Variable | Default | Description |
367
368
  |---|---|---|
369
+ | `MAX_WORKERS` | `3` | Max concurrent worker threads for slide rendering, image extraction, and VLM calls |
368
370
  | `PORT` | `8000` | HTTP port when running in server mode |
371
+ | `JOBS_DIR` | `/data/jobs` (or `./data/jobs`) | Storage directory for asynchronous background job results |
369
372
  | `OPENAI_API_KEY` | *None* | API key for Vision LLM extraction |
370
- | `OPENAI_BASE_URL` | `https://api.openai.com/v1` | Custom gateway URL (LiteLLM, Ollama, Gemini, Groq, etc.) |
373
+ | `OPENAI_BASE_URL` | *None* | Gateway URL (e.g. `https://api.openai.com/v1`, LiteLLM, Ollama, etc.) |
371
374
 
372
375
  ---
373
376
 
@@ -20,24 +20,25 @@ Available as a **Python library**, **CLI tool**, and **FastAPI microservice** (w
20
20
 
21
21
  ## Quickstart
22
22
 
23
- ### 1. Local Setup
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
- ### 2. Docker Setup
39
+ ### 3. Docker
38
40
  ```bash
39
- docker build -t super-document-processor:latest .
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 utils.pptx_converter import convert_pptx, create_pptx_render_zip
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")
@@ -327,9 +328,11 @@ docker compose up -d
327
328
 
328
329
  | Variable | Default | Description |
329
330
  |---|---|---|
331
+ | `MAX_WORKERS` | `3` | Max concurrent worker threads for slide rendering, image extraction, and VLM calls |
330
332
  | `PORT` | `8000` | HTTP port when running in server mode |
333
+ | `JOBS_DIR` | `/data/jobs` (or `./data/jobs`) | Storage directory for asynchronous background job results |
331
334
  | `OPENAI_API_KEY` | *None* | API key for Vision LLM extraction |
332
- | `OPENAI_BASE_URL` | `https://api.openai.com/v1` | Custom gateway URL (LiteLLM, Ollama, Gemini, Groq, etc.) |
335
+ | `OPENAI_BASE_URL` | *None* | Gateway URL (e.g. `https://api.openai.com/v1`, LiteLLM, Ollama, etc.) |
333
336
 
334
337
  ---
335
338
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "super-document-processor"
7
- version = "0.1.3"
7
+ version = "0.1.4"
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"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: super-document-processor
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: High-fidelity multi-format document parsing and chunking engine for RAG pipelines
5
5
  Author: Cinderfox
6
6
  License: MIT
@@ -58,24 +58,25 @@ Available as a **Python library**, **CLI tool**, and **FastAPI microservice** (w
58
58
 
59
59
  ## Quickstart
60
60
 
61
- ### 1. Local Setup
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
- ### 2. Docker Setup
77
+ ### 3. Docker
76
78
  ```bash
77
- docker build -t super-document-processor:latest .
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 utils.pptx_converter import convert_pptx, create_pptx_render_zip
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")
@@ -365,9 +366,11 @@ docker compose up -d
365
366
 
366
367
  | Variable | Default | Description |
367
368
  |---|---|---|
369
+ | `MAX_WORKERS` | `3` | Max concurrent worker threads for slide rendering, image extraction, and VLM calls |
368
370
  | `PORT` | `8000` | HTTP port when running in server mode |
371
+ | `JOBS_DIR` | `/data/jobs` (or `./data/jobs`) | Storage directory for asynchronous background job results |
369
372
  | `OPENAI_API_KEY` | *None* | API key for Vision LLM extraction |
370
- | `OPENAI_BASE_URL` | `https://api.openai.com/v1` | Custom gateway URL (LiteLLM, Ollama, Gemini, Groq, etc.) |
373
+ | `OPENAI_BASE_URL` | *None* | Gateway URL (e.g. `https://api.openai.com/v1`, LiteLLM, Ollama, etc.) |
371
374
 
372
375
  ---
373
376
 
@@ -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
- base_url = (OPENAI_BASE_URL).rstrip("/")
65
- api_key = OPENAI_API_KEY
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: