-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
222 lines (206 loc) · 4.63 KB
/
Copy pathpyproject.toml
File metadata and controls
222 lines (206 loc) · 4.63 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
[project]
name = "verso"
version = "0.1.0"
description = "High-performance document extraction to markdown/json. Extract text, tables, images from PDFs with layout detection and structure preservation."
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [{ name = "verso contributors" }]
maintainers = [{ name = "verso contributors" }]
keywords = [
"pdf",
"markdown",
"extraction",
"ocr",
"document",
"layout",
"mcp",
"mlx",
"text-extraction",
"pdf-parser",
"document-ai",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"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 :: Markup :: Markdown",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"click>=8.0",
"pillow>=9.0",
"pymupdf>=1.24.0",
]
[project.optional-dependencies]
# alternative pdf backend (slower but more permissive license)
pdftext = [
"pypdfium2>=4.0",
"pdftext>=0.3.0",
]
# office document support
office = [
"python-docx>=0.8",
"python-pptx>=0.6",
"openpyxl>=3.0",
]
# html/epub support
html = [
"beautifulsoup4>=4.9",
"markdownify>=0.11",
"ebooklib>=0.18",
]
# ocr for scanned documents
ocr = [
"surya-ocr>=0.4",
]
# layout detection models
layout = [
"surya-ocr>=0.4",
]
# deep learning models
ml = [
"torch>=2.0",
"transformers>=4.30",
"onnxruntime>=1.16",
]
# llm integration
llm = [
"openai>=1.0",
]
# mcp server for claude desktop
mcp = [
"mcp>=1.0",
]
# apple silicon optimization
mlx = [
"mlx>=0.10",
"mlx-vlm>=0.1",
]
# convenience bundles
apple = [
"verso[mlx,mcp]",
]
cpu = [
"verso[pdftext,office,html,ocr]",
]
full = [
"verso[pdftext,office,html,ocr,layout,ml,llm,mcp]",
]
# development
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"pytest-asyncio>=0.21",
"ruff>=0.4",
"mypy>=1.0",
"types-Pillow>=10.0",
"pre-commit>=3.0",
]
# documentation
docs = [
"mkdocs>=1.5",
"mkdocs-material>=9.0",
"mkdocstrings[python]>=0.24",
]
[project.scripts]
verso = "verso.cli:cli"
verso-mcp = "verso.mcp_server:main"
[project.urls]
Homepage = "https://github.com/example/verso"
Documentation = "https://github.com/example/verso#readme"
Repository = "https://github.com/example/verso"
Changelog = "https://github.com/example/verso/blob/main/CHANGELOG.md"
Issues = "https://github.com/example/verso/issues"
[build-system]
requires = ["hatchling>=1.21"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/verso/__init__.py"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
"/README.md",
"/CHANGELOG.md",
"/LICENSE",
]
[tool.hatch.build.targets.wheel]
packages = ["src/verso"]
[tool.ruff]
line-length = 88
target-version = "py310"
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"W", # pycodestyle warnings
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # function call in default argument
"SIM108", # ternary instead of if-else
]
[tool.ruff.lint.isort]
known-first-party = ["verso"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_ignores = true
ignore_missing_imports = true
exclude = [
"tests/",
"research/",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
asyncio_mode = "auto"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
[tool.coverage.run]
source = ["src/verso"]
branch = true
omit = [
"*/tests/*",
"*/__pycache__/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]