-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
257 lines (237 loc) · 6.83 KB
/
pyproject.toml
File metadata and controls
257 lines (237 loc) · 6.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "longparser"
version = "0.1.4"
description = "Privacy-first document intelligence engine — converts PDFs, DOCX, PPTX, XLSX, and CSV into AI-ready Markdown + structured JSON for RAG pipelines."
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.10"
license = "MIT"
authors = [
{name = "ENDEVSOLS Team", email = "technology@endevsols.com"},
]
keywords = [
"pdf", "document", "parsing", "ocr", "rag", "ai",
"docling", "chunking", "extraction", "retrieval-augmented-generation",
"longparser",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Text Processing :: General",
"Typing :: Typed",
]
dependencies = [
"pydantic>=2.0,<3",
"docling>=2.14",
"docling-core>=2.13",
"langgraph-checkpoint-mongodb>=0.3.1",
"fast-langdetect>=0.3,<1.0", # Apache-2.0 — document language detection
]
[project.optional-dependencies]
# PPTX support (indent-level detection via python-pptx)
pptx = [
"python-pptx>=1.0",
]
# LangChain integration adapter
langchain = [
"langchain-core>=0.2",
]
# LlamaIndex integration adapter
llamaindex = [
"llama-index-core>=0.10",
]
# ----------- v0.1.4: Optional extraction backends -----------
# ⚠️ pymupdf4llm is AGPL-3.0 licensed. See LICENSE-THIRD-PARTY.md.
# Only loaded when user sets backend="pymupdf".
pymupdf = [
"pymupdf4llm>=1.27",
]
# ⚠️ marker-pdf is GPL-3.0. GPU recommended. Future release.
# marker = [
# "marker-pdf",
# ]
# ⚠️ surya-ocr is GPL-3.0. GPU recommended. Future release.
# surya = [
# "surya-ocr>=0.17",
# ]
# FastAPI REST server + MongoDB + job queue + LangChain chat engine
server = [
"fastapi>=0.115",
"uvicorn[standard]>=0.34",
"python-multipart>=0.0.9",
"motor>=3.6",
"arq>=0.26",
"python-magic>=0.4.27",
"python-dotenv>=1.0",
"langchain>=0.3",
"langchain-openai>=0.3",
"langchain-google-genai>=2.0",
"langchain-groq>=0.3",
"langchain-mongodb>=0.3",
"langchain-huggingface>=0.1",
"langchain-chroma>=0.2",
"langgraph>=0.2",
"langgraph-checkpoint>=2.0",
"tiktoken>=0.7",
"redis>=5.0",
]
# ---------------------------------------------------------------------------
# Embedding engines
# Pre-install torch BEFORE these extras:
# CPU: pip install torch --index-url https://download.pytorch.org/whl/cpu
# GPU: pip install torch (default PyPI = CUDA)
# ---------------------------------------------------------------------------
embeddings = [
"sentence-transformers>=3.0",
]
# Alias kept for clarity — same package, torch variant controls CPU/GPU
embeddings-cpu = [
"sentence-transformers>=3.0",
]
embeddings-gpu = [
"sentence-transformers>=3.0",
]
# ---------------------------------------------------------------------------
# Vector databases — faiss has separate CPU and GPU packages on PyPI
# ---------------------------------------------------------------------------
chroma = [
"chromadb>=0.5",
]
faiss-cpu = [
"faiss-cpu>=1.8",
]
faiss-gpu = [
"faiss-gpu>=1.7",
]
qdrant = [
"qdrant-client>=1.12",
]
# ---------------------------------------------------------------------------
# LaTeX / equation OCR
# Pre-install torch (see above) before installing these extras.
# ---------------------------------------------------------------------------
# LaTeX OCR via pix2tex (PDF formulas)
latex-ocr = [
"pix2tex>=0.1.4",
]
latex-ocr-cpu = [
"pix2tex>=0.1.4",
]
latex-ocr-gpu = [
"pix2tex>=0.1.4",
]
# LaTeX equation extraction from DOCX/PPTX (no torch needed)
docx-equations = [
"docxlatex>=0.3.0",
"defusedxml>=0.7.0",
]
# Page-level Math Formula Detection via pix2text YOLO (MIT licence)
mfd = [
"pix2text>=1.1.1,<1.2",
]
# ---------------------------------------------------------------------------
# Convenience meta-extras
# Usage:
# CPU-only (no CUDA):
# pip install torch --index-url https://download.pytorch.org/whl/cpu
# pip install "longparser[cpu]"
#
# GPU / CUDA:
# pip install torch # default PyPI wheel = CUDA
# pip install "longparser[gpu]"
# ---------------------------------------------------------------------------
cpu = [
"longparser[server]",
"longparser[embeddings-cpu]",
"longparser[faiss-cpu]",
"longparser[latex-ocr-cpu]",
"longparser[chroma]",
"longparser[pptx]",
"longparser[langchain]",
"longparser[llamaindex]",
]
gpu = [
"longparser[server]",
"longparser[embeddings-gpu]",
"longparser[faiss-gpu]",
"longparser[latex-ocr-gpu]",
"longparser[chroma]",
"longparser[pptx]",
"longparser[langchain]",
"longparser[llamaindex]",
]
# Legacy / catch-all (defaults to CPU-safe)
all = [
"longparser[cpu]",
]
# Development / testing
dev = [
"pytest>=8.0",
"pytest-asyncio>=0.23",
"pytest-cov>=5.0",
"ruff>=0.4",
"mypy>=1.10",
"build>=1.0",
"twine>=5.0",
"httpx>=0.27",
"anyio>=4.0",
]
[project.urls]
Homepage = "https://github.com/ENDEVSOLS/LongParser"
Repository = "https://github.com/ENDEVSOLS/LongParser"
Issues = "https://github.com/ENDEVSOLS/LongParser/issues"
Documentation = "https://endevsols.github.io/LongParser/"
Changelog = "https://github.com/ENDEVSOLS/LongParser/blob/main/CHANGELOG.md"
[tool.setuptools.packages.find]
where = ["src"]
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]
ignore = ["E501"]
[tool.ruff.lint.isort]
known-first-party = ["longparser"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
asyncio_mode = "auto"
addopts = "-v --tb=short"
[tool.mypy]
python_version = "3.10"
strict = false
ignore_missing_imports = true
warn_unused_ignores = true
[tool.coverage.run]
source = ["src/longparser"]
omit = [
"tests/*",
# These modules require heavy optional deps (server, langchain, docling GPU)
# not installed in the lightweight CI environment
"src/longparser/server/*",
"src/longparser/extractors/docling_extractor.py",
"src/longparser/extractors/latex_ocr.py",
"src/longparser/integrations/*",
"src/longparser/pipeline/*",
]
[tool.coverage.report]
show_missing = true
fail_under = 5
# CPU-only PyTorch index — saves ~2.3 GB vs CUDA build
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = [{ index = "pytorch-cpu" }]
torchvision = [{ index = "pytorch-cpu" }]