Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
160 lines (148 loc) · 4.83 KB
/
Copy pathpyproject.toml
File metadata and controls
160 lines (148 loc) · 4.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
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "docket-idp"
dynamic = ["version"]
description = "Invoice and receipt OCR for Python: extract cited, validated data with local or hosted LLMs"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE"]
authors = [{ name = "Artem Kazakov Kozlov" }]
requires-python = ">=3.10"
keywords = [
"invoice", "receipt", "ocr", "llm", "document-ai", "idp",
"e-invoicing", "ubl", "peppol", "zugferd", "factur-x", "xrechnung", "facturae",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Financial and Insurance Industry",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business :: Financial :: Accounting",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Text Processing",
"Typing :: Typed",
]
dependencies = [
"pydantic>=2.6",
"pdfplumber>=0.11",
"pypdfium2>=4.20",
"pytesseract>=0.3.10",
"pillow>=10.0",
"httpx>=0.27",
"python-dotenv>=1.0",
"tomli>=2.0; python_version < \"3.11\"",
"scikit-learn>=1.4",
]
[project.optional-dependencies]
api = [
"docket-idp[review]",
"fastapi>=0.110",
"uvicorn>=0.29",
"python-multipart>=0.0.9",
]
# Crop and flatten documents in phone photos before OCR.
photo = [
"opencv-python-headless>=4.8",
]
# Persistent review queue (ReviewOptions(enqueue=True)); SQLite by default.
review = [
"SQLAlchemy>=2.0,<3",
]
tracing = [
"langfuse>=2.0",
]
postgres = [
"docket-idp[review]",
"psycopg[binary]>=3.2,<4",
]
# PaddleOCR backend (`--ocr-backend paddle`), including its table-structure
# pipeline. Heavy (PaddlePaddle + models downloaded on first use), so never
# part of the base install.
paddle = [
"paddlepaddle>=3.0,<4",
"paddleocr>=3.0,<4",
"paddlex[ocr]>=3.0,<4",
]
# Docling layout pipeline and TableFormer. Models are downloaded by Docling
# on first use; importing docket never imports this optional dependency.
docling = [
"docling>=2.81,<3",
]
# Official e-invoice validation (XSD via lxml, Schematron via SaxonC-HE).
# Artifacts with verified redistribution terms ship with the package; the
# rest (Peppol, CII D16B, Factur-X) come from `docket einvoice fetch`.
einvoice = [
"factur-x>=6.8,<7",
"lxml>=5.0",
"saxonche>=12.5",
]
all = [
"docket-idp[api,tracing,einvoice,postgres,photo]",
]
eval = [
"datasets>=2.19",
]
dev = [
"docket-idp[api,eval,einvoice,photo]",
# The Streamlit demo (examples/streamlit_demo.py) is a repo-only dev tool.
"streamlit>=1.49",
"pytest>=8.0",
# Test fixtures only (builds PDFs with a text layer); never a runtime
# dependency, so its AGPL license does not reach installed users.
"pymupdf>=1.24",
"build>=1.2",
"twine>=5.0",
# Pinned: new releases add default rules; bump deliberately, with the fixes.
"ruff==0.16.8",
"mypy==1.18.2",
]
[project.scripts]
docket = "docket.cli:run"
docket-api = "docket.api:run"
[project.urls]
Homepage = "https://github.com/KazKozDev/docket"
Documentation = "https://github.com/KazKozDev/docket#readme"
Repository = "https://github.com/KazKozDev/docket"
Issues = "https://github.com/KazKozDev/docket/issues"
Changelog = "https://github.com/KazKozDev/docket/blob/master/CHANGELOG.md"
[tool.setuptools.dynamic]
version = { attr = "docket.__version__" }
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
docket = ["py.typed", "einvoice/resources/**/*", "static/**/*"]
# Present in a development checkout after scripts/update_einvoice_resources.py,
# but never shipped: users download them with `docket einvoice fetch`.
[tool.setuptools.exclude-package-data]
docket = [
"einvoice/resources/peppol/*",
"einvoice/resources/peppol/**/*",
"einvoice/resources/factur-x/**/*",
"einvoice/resources/cii-d16b/**/*",
]
[tool.ruff.lint]
ignore = [
"C408", # dict(key=...) reads better than a literal in kwargs-style test factories
"DTZ", # document dates are calendar dates, not instants; there is no zone to attach
]
[tool.ruff.lint.flake8-bugbear]
# FastAPI declares request parameters as call defaults by design.
extend-immutable-calls = ["fastapi.File", "fastapi.Form", "fastapi.Depends", "fastapi.Header"]
[tool.mypy]
files = ["src/docket"]
# Optional extras (paddleocr, docling, saxonche, langfuse, ...) ship no stubs.
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"paddle: runs the real PaddleOCR engine (skipped when it is not installed)",
]
pythonpath = ["."]