-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathpyproject.toml
More file actions
177 lines (163 loc) · 4.05 KB
/
Copy pathpyproject.toml
File metadata and controls
177 lines (163 loc) · 4.05 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
[build-system]
requires = ["uv_build>=0.8.15,<0.9.0"]
build-backend = "uv_build"
[project]
name = "attachments"
version = "1.0.0a1" # pre-release: pip install attachments will NOT pick this up; see VISION.md
description = "Turn anything into LLM-ready artifacts. Universal file and source processing."
readme = "README.md"
requires-python = ">=3.12"
authors = [{ name = "Maxime Rivest", email = "mrive052@gmail.com" }]
license = "MIT"
license-files = ["LICENSE"]
keywords = [
"llm",
"context",
"pdf",
"docx",
"xlsx",
"pptx",
"extraction",
"rag",
"prompt",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Text Processing",
]
# ZERO required dependencies - everything is optional
dependencies = []
[project.optional-dependencies]
# === Individual Processors ===
pdf = [
"pypdf>=4.0", # Modern pypdf (not pypdf2)
"pymupdf>=1.24", # For image rendering
]
pdf-fallback = [
"pdfminer.six>=20221105", # Fallback text extraction
]
xlsx = [
"openpyxl>=3.1,<4.0",
]
xlsx-pandas = [
"pandas>=2.0,<3.0",
"openpyxl>=3.1,<4.0",
]
docx = [
"python-docx>=1.0",
]
pptx = [
"python-pptx>=0.6.23",
]
html = [
"beautifulsoup4>=4.12",
"lxml>=5.0",
]
image = [
"pillow>=10.0",
]
heic = [
"pillow>=10.0",
"pillow-heif>=0.16",
]
svg = [
"cairosvg>=2.7",
]
xls = [
"xlrd>=2.0",
]
csv-pandas = [
"pandas>=2.0,<3.0",
]
ocr = [
"rapidocr-onnxruntime>=1.3",
]
audio = [
"faster-whisper>=1.0",
]
mcp = [
"mcp>=1.2",
]
# === Service Mode (minimal - just HTTP client) ===
service = [
"httpx>=0.27",
]
# === CLI clipboard support (`att --copy`) ===
clipboard = [
"pyperclip>=1.8",
]
# === Convenience Bundles ===
# Only formats with shipped processors belong here. New processors (audio,
# s3://, gdrive://, ...) are added as they land - see VISION.md.
office = [
"attachments[xlsx,docx,pptx]",
]
all-local = [
"attachments[pdf,pdf-fallback,xlsx-pandas,docx,pptx,html,image,heic,svg,xls,csv-pandas]",
]
# === Self-Hosted Server ===
# Install this on your server machine to serve all formats to clients.
# ocr (onnxruntime) and audio (ctranslate2 via faster-whisper) ship very
# large wheels, so they are deliberately NOT in all-local — local installs
# opt in with attachments[ocr] / attachments[audio]. The server bundle
# includes them because a server should serve everything.
server = [
"attachments[all-local,ocr,audio]",
]
[project.urls]
Homepage = "https://github.com/MaximeRivest/attachments"
Repository = "https://github.com/MaximeRivest/attachments"
Documentation = "https://github.com/MaximeRivest/attachments"
[dependency-groups]
dev = [
"ruff",
"pytest",
"pytest-cov",
"pre-commit",
# Service mode for testing
"httpx>=0.27",
# Common processors for testing
"pypdf>=4.0",
"pymupdf>=1.24",
"openpyxl>=3.1,<4.0",
"pandas>=2.0,<3.0",
"python-docx>=1.0",
"python-pptx>=0.6.23",
"beautifulsoup4>=4.12",
"lxml>=5.0",
"pillow>=10.0",
"pillow-heif>=0.16",
"cairosvg>=2.7",
"xlrd>=2.0",
"rapidocr-onnxruntime>=1.3",
"faster-whisper>=1.0",
"mcp>=1.2",
# CLI clipboard support (`att --copy`)
"pyperclip>=1.8",
# Spec conformance validation
"jsonschema>=4.21",
# Dev tools
"ipykernel>=6.30.1",
"gunicorn>=25.0",
]
[project.scripts]
attachments-server = "attachments.server:main"
attachments-mcp = "attachments.mcp_server:main"
attachments = "attachments.cli:app"
att = "attachments.cli:app"
[tool.ruff]
line-length = 88
target-version = "py312"
extend-exclude = ["docs/_freeze", "build", "dist"]
[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP"]
[tool.ruff.format]
docstring-code-format = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q --strict-markers --color=yes --cov=attachments --cov-report=term-missing --doctest-modules"
testpaths = ["tests", "src"]