dot-parser 2.0.0__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.
- dot_parser-2.0.0/.gitignore +119 -0
- dot_parser-2.0.0/.gitlab-ci.yml +181 -0
- dot_parser-2.0.0/.pre-commit-config.yaml +34 -0
- dot_parser-2.0.0/.python-version +1 -0
- dot_parser-2.0.0/AUTHORS.md +13 -0
- dot_parser-2.0.0/CHANGELOG.md +45 -0
- dot_parser-2.0.0/CONTRIBUTING.md +87 -0
- dot_parser-2.0.0/DCO +34 -0
- dot_parser-2.0.0/LICENSE.md +660 -0
- dot_parser-2.0.0/PKG-INFO +274 -0
- dot_parser-2.0.0/README.md +238 -0
- dot_parser-2.0.0/benchmark/README.md +76 -0
- dot_parser-2.0.0/benchmark/input/broken_encoding.pdf +0 -0
- dot_parser-2.0.0/benchmark/input/image_only.pdf +0 -0
- dot_parser-2.0.0/benchmark/input/native_equations.pdf +0 -0
- dot_parser-2.0.0/benchmark/input/native_simple.pdf +0 -0
- dot_parser-2.0.0/benchmark/input/native_tables.pdf +0 -0
- dot_parser-2.0.0/benchmark/output/md/out_docling_broken_encoding.md +361 -0
- dot_parser-2.0.0/benchmark/output/md/out_docling_image_only.md +315 -0
- dot_parser-2.0.0/benchmark/output/md/out_docling_native_equations.md +972 -0
- dot_parser-2.0.0/benchmark/output/md/out_docling_native_simple.md +327 -0
- dot_parser-2.0.0/benchmark/output/md/out_docling_native_tables.md +543 -0
- dot_parser-2.0.0/benchmark/output/md/out_llama_broken_encoding.md +1493 -0
- dot_parser-2.0.0/benchmark/output/md/out_llama_image_only.md +769 -0
- dot_parser-2.0.0/benchmark/output/md/out_llama_native_equations.md +8795 -0
- dot_parser-2.0.0/benchmark/output/md/out_llama_native_simple.md +760 -0
- dot_parser-2.0.0/benchmark/output/md/out_llama_native_tables.md +2659 -0
- dot_parser-2.0.0/benchmark/output/md/out_mistral_batch_broken_encoding.md +394 -0
- dot_parser-2.0.0/benchmark/output/md/out_mistral_batch_image_only.md +386 -0
- dot_parser-2.0.0/benchmark/output/md/out_mistral_batch_native_equations.md +1165 -0
- dot_parser-2.0.0/benchmark/output/md/out_mistral_batch_native_simple.md +379 -0
- dot_parser-2.0.0/benchmark/output/md/out_mistral_batch_native_tables.md +604 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_broken_encoding.md +399 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_image_only.md +186 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_native_equations.md +1804 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_native_simple.md +418 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_native_tables.md +574 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_ocr_broken_encoding.md +395 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_ocr_image_only.md +182 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_ocr_native_equations.md +1804 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_ocr_native_simple.md +418 -0
- dot_parser-2.0.0/benchmark/output/md/out_pymu_ocr_native_tables.md +574 -0
- dot_parser-2.0.0/benchmark/output/results.md +11 -0
- dot_parser-2.0.0/benchmark/run.py +396 -0
- dot_parser-2.0.0/docs/DESIGN.md +38 -0
- dot_parser-2.0.0/docs/DEVELOPMENT.md +119 -0
- dot_parser-2.0.0/docs/IMAGE_EXTRACTION.md +130 -0
- dot_parser-2.0.0/docs/PUBLISHING.md +123 -0
- dot_parser-2.0.0/docs/VERSIONING.md +120 -0
- dot_parser-2.0.0/pyproject.toml +121 -0
- dot_parser-2.0.0/src/dot_parser/__init__.py +49 -0
- dot_parser-2.0.0/src/dot_parser/backends/__init__.py +26 -0
- dot_parser-2.0.0/src/dot_parser/backends/_base.py +79 -0
- dot_parser-2.0.0/src/dot_parser/backends/docling.py +59 -0
- dot_parser-2.0.0/src/dot_parser/backends/llama.py +76 -0
- dot_parser-2.0.0/src/dot_parser/backends/mistral.py +622 -0
- dot_parser-2.0.0/src/dot_parser/backends/pymu.py +56 -0
- dot_parser-2.0.0/src/dot_parser/chunking.py +257 -0
- dot_parser-2.0.0/src/dot_parser/docx_images.py +633 -0
- dot_parser-2.0.0/src/dot_parser/image_utils.py +152 -0
- dot_parser-2.0.0/src/dot_parser/images.py +125 -0
- dot_parser-2.0.0/src/dot_parser/markdown_utils.py +48 -0
- dot_parser-2.0.0/src/dot_parser/models.py +22 -0
- dot_parser-2.0.0/src/dot_parser/parsers.py +325 -0
- dot_parser-2.0.0/src/dot_parser/pricing.py +58 -0
- dot_parser-2.0.0/src/dot_parser/tokens.py +6 -0
- dot_parser-2.0.0/src/dot_parser/vlms.py +203 -0
- dot_parser-2.0.0/tests/test_chunking.py +93 -0
- dot_parser-2.0.0/tests/test_images.py +1262 -0
- dot_parser-2.0.0/tests/test_mistral_batch_logging.py +124 -0
- dot_parser-2.0.0/tests/test_parsers.py +200 -0
- dot_parser-2.0.0/tests/test_tokens.py +20 -0
- dot_parser-2.0.0/uv.lock +2979 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# --- Project-specific ---
|
|
2
|
+
working-notes/
|
|
3
|
+
# Scratch parse/benchmark runs. Tracked fixtures live in benchmark/input and
|
|
4
|
+
# benchmark/output/md, so only these throwaway locations are ignored.
|
|
5
|
+
scratch/
|
|
6
|
+
tmp/
|
|
7
|
+
out/
|
|
8
|
+
*.local.*
|
|
9
|
+
|
|
10
|
+
# --- Secrets / local config ---
|
|
11
|
+
.env
|
|
12
|
+
.env.*
|
|
13
|
+
!.env.example
|
|
14
|
+
*.pem
|
|
15
|
+
*.key
|
|
16
|
+
credentials.json
|
|
17
|
+
secrets.yaml
|
|
18
|
+
secrets.yml
|
|
19
|
+
|
|
20
|
+
# --- Python bytecode / build artifacts ---
|
|
21
|
+
__pycache__/
|
|
22
|
+
*.py[cod]
|
|
23
|
+
*$py.class
|
|
24
|
+
*.so
|
|
25
|
+
build/
|
|
26
|
+
dist/
|
|
27
|
+
sdist/
|
|
28
|
+
wheels/
|
|
29
|
+
develop-eggs/
|
|
30
|
+
eggs/
|
|
31
|
+
.eggs/
|
|
32
|
+
*.egg-info/
|
|
33
|
+
*.egg
|
|
34
|
+
MANIFEST
|
|
35
|
+
pip-wheel-metadata/
|
|
36
|
+
share/python-wheels/
|
|
37
|
+
|
|
38
|
+
# --- Virtual environments ---
|
|
39
|
+
.venv/
|
|
40
|
+
venv/
|
|
41
|
+
env/
|
|
42
|
+
ENV/
|
|
43
|
+
.uv/
|
|
44
|
+
|
|
45
|
+
# --- Testing / coverage / type checking ---
|
|
46
|
+
.pytest_cache/
|
|
47
|
+
.cache/
|
|
48
|
+
.tox/
|
|
49
|
+
.nox/
|
|
50
|
+
htmlcov/
|
|
51
|
+
.coverage
|
|
52
|
+
.coverage.*
|
|
53
|
+
coverage.xml
|
|
54
|
+
*.cover
|
|
55
|
+
nosetests.xml
|
|
56
|
+
.hypothesis/
|
|
57
|
+
.mypy_cache/
|
|
58
|
+
.dmypy.json
|
|
59
|
+
dmypy.json
|
|
60
|
+
.pyre/
|
|
61
|
+
.pytype/
|
|
62
|
+
.ruff_cache/
|
|
63
|
+
.ty_cache/
|
|
64
|
+
|
|
65
|
+
# --- Notebooks ---
|
|
66
|
+
.ipynb_checkpoints/
|
|
67
|
+
profile_default/
|
|
68
|
+
ipython_config.py
|
|
69
|
+
|
|
70
|
+
# --- Docs ---
|
|
71
|
+
docs/_build/
|
|
72
|
+
site/
|
|
73
|
+
|
|
74
|
+
# --- Logs & databases ---
|
|
75
|
+
*.log
|
|
76
|
+
logs/
|
|
77
|
+
*.sqlite
|
|
78
|
+
*.sqlite3
|
|
79
|
+
*.db
|
|
80
|
+
|
|
81
|
+
# --- Editors / IDEs ---
|
|
82
|
+
.idea/
|
|
83
|
+
.vscode/
|
|
84
|
+
!.vscode/settings.json
|
|
85
|
+
!.vscode/extensions.json
|
|
86
|
+
*.swp
|
|
87
|
+
*.swo
|
|
88
|
+
*~
|
|
89
|
+
.spyderproject
|
|
90
|
+
.spyproject
|
|
91
|
+
.ropeproject
|
|
92
|
+
|
|
93
|
+
# --- OS cruft ---
|
|
94
|
+
.DS_Store
|
|
95
|
+
.DS_Store?
|
|
96
|
+
._*
|
|
97
|
+
.Spotlight-V100
|
|
98
|
+
.Trashes
|
|
99
|
+
Thumbs.db
|
|
100
|
+
ehthumbs.db
|
|
101
|
+
Desktop.ini
|
|
102
|
+
|
|
103
|
+
# --- Agent config ---
|
|
104
|
+
.agents/
|
|
105
|
+
.claude/
|
|
106
|
+
|
|
107
|
+
# --- Local scratch ---
|
|
108
|
+
local/
|
|
109
|
+
sources/
|
|
110
|
+
working-notes/
|
|
111
|
+
|
|
112
|
+
# --- Pin Python: versioned on purpose, overrides the global ignore ---
|
|
113
|
+
!.python-version
|
|
114
|
+
|
|
115
|
+
# --- CI caches (UV_CACHE_DIR / PRE_COMMIT_HOME point here in .gitlab-ci.yml) ---
|
|
116
|
+
# Not just local hygiene: hatchling would otherwise pull them into the sdist,
|
|
117
|
+
# and a cached virtualenv carries absolute symlinks that break the build.
|
|
118
|
+
.uv-cache/
|
|
119
|
+
.pre-commit-cache/
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Pipeline for a Python library published to PyPI.
|
|
2
|
+
#
|
|
3
|
+
# quality lint, format and type checks (pre-commit)
|
|
4
|
+
# test pytest on every supported Python version
|
|
5
|
+
# publish tag-only: build, then TestPyPI, then PyPI behind a manual gate
|
|
6
|
+
#
|
|
7
|
+
# Publishing uses PyPI Trusted Publishing (OIDC): GitLab mints a short-lived ID
|
|
8
|
+
# token, PyPI exchanges it for a publish token valid for minutes. No API token
|
|
9
|
+
# is stored in the project. Declare this repository as a trusted publisher at
|
|
10
|
+
# https://pypi.org/manage/project/dot-parser/settings/publishing/ (and the same on
|
|
11
|
+
# test.pypi.org) before the first release.
|
|
12
|
+
|
|
13
|
+
workflow:
|
|
14
|
+
rules:
|
|
15
|
+
# Merge requests take priority...
|
|
16
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
17
|
+
when: always
|
|
18
|
+
# ...release tags (vX.Y.Z, optionally -rc.N)...
|
|
19
|
+
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+(?:-rc\.\d+)?$/
|
|
20
|
+
when: always
|
|
21
|
+
# ...and pushes to main. The MR rule above keeps this from double-firing.
|
|
22
|
+
- if: $CI_COMMIT_BRANCH == "main"
|
|
23
|
+
when: always
|
|
24
|
+
# Anything else (branch pushes without an MR, malformed tags) runs nothing.
|
|
25
|
+
- when: never
|
|
26
|
+
|
|
27
|
+
stages:
|
|
28
|
+
- quality
|
|
29
|
+
- test
|
|
30
|
+
- publish
|
|
31
|
+
|
|
32
|
+
variables:
|
|
33
|
+
UV_CACHE_DIR: "$CI_PROJECT_DIR/.uv-cache"
|
|
34
|
+
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.pre-commit-cache"
|
|
35
|
+
# Keep resolution reproducible: fail rather than silently relock.
|
|
36
|
+
UV_FROZEN: "1"
|
|
37
|
+
|
|
38
|
+
default:
|
|
39
|
+
image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
|
40
|
+
cache:
|
|
41
|
+
key:
|
|
42
|
+
files:
|
|
43
|
+
- uv.lock
|
|
44
|
+
paths:
|
|
45
|
+
- .uv-cache
|
|
46
|
+
- .pre-commit-cache
|
|
47
|
+
|
|
48
|
+
# --------------------------------------------------------------------------
|
|
49
|
+
# quality
|
|
50
|
+
# --------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
quality:
|
|
53
|
+
stage: quality
|
|
54
|
+
before_script:
|
|
55
|
+
- apt-get update && apt-get install -y --no-install-recommends git
|
|
56
|
+
- uv sync --all-extras --all-groups
|
|
57
|
+
script:
|
|
58
|
+
- uv run pre-commit run --all-files --show-diff-on-failure
|
|
59
|
+
|
|
60
|
+
# --------------------------------------------------------------------------
|
|
61
|
+
# test
|
|
62
|
+
# --------------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
test:
|
|
65
|
+
stage: test
|
|
66
|
+
image: ghcr.io/astral-sh/uv:python$PYTHON_VERSION-bookworm-slim
|
|
67
|
+
parallel:
|
|
68
|
+
matrix:
|
|
69
|
+
# Every version the package claims to support in requires-python.
|
|
70
|
+
- PYTHON_VERSION: ["3.12", "3.13"]
|
|
71
|
+
before_script:
|
|
72
|
+
- uv sync --all-extras --all-groups --python "$PYTHON_VERSION"
|
|
73
|
+
script:
|
|
74
|
+
- uv run --python "$PYTHON_VERSION" pytest --cov=src --cov-report=term --cov-report=xml
|
|
75
|
+
coverage: '/^TOTAL.*\s+(\d+%)$/'
|
|
76
|
+
artifacts:
|
|
77
|
+
when: always
|
|
78
|
+
reports:
|
|
79
|
+
coverage_report:
|
|
80
|
+
coverage_format: cobertura
|
|
81
|
+
path: coverage.xml
|
|
82
|
+
|
|
83
|
+
# --------------------------------------------------------------------------
|
|
84
|
+
# publish (release tags only)
|
|
85
|
+
# --------------------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
# The tag drives the release, so it must agree with the packaged version:
|
|
88
|
+
# publishing v1.2.3 from a tree that says 1.2.2 cannot be undone on PyPI.
|
|
89
|
+
check_version:
|
|
90
|
+
stage: publish
|
|
91
|
+
script:
|
|
92
|
+
- VERSION="$(uv version --short)"
|
|
93
|
+
- |
|
|
94
|
+
if [ "v$VERSION" != "$CI_COMMIT_TAG" ]; then
|
|
95
|
+
echo "Tag $CI_COMMIT_TAG does not match project version v$VERSION."
|
|
96
|
+
echo "Run 'uv version <new>' and retag."
|
|
97
|
+
exit 1
|
|
98
|
+
fi
|
|
99
|
+
- echo "Tag matches version v$VERSION."
|
|
100
|
+
rules:
|
|
101
|
+
- if: $CI_COMMIT_TAG
|
|
102
|
+
|
|
103
|
+
build:
|
|
104
|
+
stage: publish
|
|
105
|
+
needs: ["check_version"]
|
|
106
|
+
# No cache here on purpose: the shared cache restores .uv-cache/ and
|
|
107
|
+
# .pre-commit-cache/ into the project directory, and the sdist would pick
|
|
108
|
+
# them up — cached virtualenvs carry absolute symlinks that fail the build.
|
|
109
|
+
cache: []
|
|
110
|
+
script:
|
|
111
|
+
# --no-sources ignores tool.uv.sources, so the build matches what a user
|
|
112
|
+
# installing from PyPI will actually get.
|
|
113
|
+
- uv build --no-sources
|
|
114
|
+
- ls -l dist/
|
|
115
|
+
artifacts:
|
|
116
|
+
paths:
|
|
117
|
+
- dist/
|
|
118
|
+
expire_in: 1 week
|
|
119
|
+
rules:
|
|
120
|
+
- if: $CI_COMMIT_TAG
|
|
121
|
+
|
|
122
|
+
.publish:
|
|
123
|
+
stage: publish
|
|
124
|
+
needs: ["build"]
|
|
125
|
+
before_script:
|
|
126
|
+
- apt-get update && apt-get install -y --no-install-recommends curl jq
|
|
127
|
+
script:
|
|
128
|
+
# Exchange the GitLab OIDC token for a short-lived PyPI publish token.
|
|
129
|
+
# Never echoed: it would land in the job log in clear text.
|
|
130
|
+
- |
|
|
131
|
+
MINTED="$(curl -sS -X POST "$PYPI_MINT_URL" \
|
|
132
|
+
-H 'Content-Type: application/json' \
|
|
133
|
+
-d "{\"token\":\"${PYPI_ID_TOKEN}\"}" | jq -r '.token // empty')"
|
|
134
|
+
if [ -z "$MINTED" ]; then
|
|
135
|
+
echo "Could not mint a publish token. Is this project registered as a"
|
|
136
|
+
echo "trusted publisher on $PYPI_HOST, with the right branch/tag rules?"
|
|
137
|
+
exit 1
|
|
138
|
+
fi
|
|
139
|
+
export UV_PUBLISH_TOKEN="$MINTED"
|
|
140
|
+
- uv publish --publish-url "$PYPI_PUBLISH_URL" dist/*
|
|
141
|
+
|
|
142
|
+
publish_testpypi:
|
|
143
|
+
extends: .publish
|
|
144
|
+
id_tokens:
|
|
145
|
+
PYPI_ID_TOKEN:
|
|
146
|
+
aud: testpypi
|
|
147
|
+
variables:
|
|
148
|
+
PYPI_HOST: test.pypi.org
|
|
149
|
+
PYPI_MINT_URL: https://test.pypi.org/_/oidc/mint-token
|
|
150
|
+
PYPI_PUBLISH_URL: https://test.pypi.org/legacy/
|
|
151
|
+
environment:
|
|
152
|
+
name: testpypi
|
|
153
|
+
url: https://test.pypi.org/project/dot-parser/
|
|
154
|
+
rules:
|
|
155
|
+
- if: $CI_COMMIT_TAG
|
|
156
|
+
|
|
157
|
+
publish_pypi:
|
|
158
|
+
extends: .publish
|
|
159
|
+
# `extends` REPLACES `needs`, it does not merge it: redeclaring the
|
|
160
|
+
# dependency on publish_testpypi drops the one on build inherited from
|
|
161
|
+
# `.publish`, and the job starts with an empty dist/ ("No files found to
|
|
162
|
+
# publish"). Both edges have to be spelled out here.
|
|
163
|
+
needs:
|
|
164
|
+
- job: build
|
|
165
|
+
artifacts: true
|
|
166
|
+
- job: publish_testpypi
|
|
167
|
+
artifacts: false
|
|
168
|
+
id_tokens:
|
|
169
|
+
PYPI_ID_TOKEN:
|
|
170
|
+
aud: pypi
|
|
171
|
+
variables:
|
|
172
|
+
PYPI_HOST: pypi.org
|
|
173
|
+
PYPI_MINT_URL: https://pypi.org/_/oidc/mint-token
|
|
174
|
+
PYPI_PUBLISH_URL: https://upload.pypi.org/legacy/
|
|
175
|
+
environment:
|
|
176
|
+
name: pypi
|
|
177
|
+
url: https://pypi.org/project/dot-parser/
|
|
178
|
+
rules:
|
|
179
|
+
# Manual on purpose: a PyPI release cannot be taken back, only yanked.
|
|
180
|
+
- if: $CI_COMMIT_TAG
|
|
181
|
+
when: manual
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Verbatim legal texts (the AGPL and the DCO both forbid modification) and
|
|
2
|
+
# generated parser outputs, kept byte-for-byte as the backends produced them.
|
|
3
|
+
exclude: '^(LICENSE\.md|DCO|benchmark/output/)'
|
|
4
|
+
|
|
5
|
+
repos:
|
|
6
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
7
|
+
rev: v6.0.0
|
|
8
|
+
hooks:
|
|
9
|
+
- id: trailing-whitespace
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
- id: check-yaml
|
|
12
|
+
- id: check-toml
|
|
13
|
+
- id: check-merge-conflict
|
|
14
|
+
- id: check-case-conflict
|
|
15
|
+
- id: check-added-large-files
|
|
16
|
+
args: ["--maxkb=1000"]
|
|
17
|
+
- id: detect-private-key
|
|
18
|
+
- id: debug-statements
|
|
19
|
+
|
|
20
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
21
|
+
rev: v0.16.0
|
|
22
|
+
hooks:
|
|
23
|
+
- id: ruff-check
|
|
24
|
+
args: [--fix]
|
|
25
|
+
- id: ruff-format
|
|
26
|
+
|
|
27
|
+
- repo: local
|
|
28
|
+
hooks:
|
|
29
|
+
- id: ty
|
|
30
|
+
name: ty (type check)
|
|
31
|
+
entry: uv run --frozen ty check
|
|
32
|
+
language: system
|
|
33
|
+
types: [python]
|
|
34
|
+
pass_filenames: false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Authors
|
|
2
|
+
|
|
3
|
+
Copyright in this project is held by **Kannon For Deep Tech**.
|
|
4
|
+
This file credits the individuals who have contributed to it. Being listed
|
|
5
|
+
here does not confer any ownership of, or rights in, the project.
|
|
6
|
+
|
|
7
|
+
## Kannon For Deep Tech
|
|
8
|
+
|
|
9
|
+
- Adrien Marjollet
|
|
10
|
+
- Jean Fechter
|
|
11
|
+
- Noé Malais
|
|
12
|
+
|
|
13
|
+
## External contributors
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [2.0.0] - 2026-07-30
|
|
11
|
+
|
|
12
|
+
First public release.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `parse()` converts PDF, DOCX, PPTX, HTML, XLSX, CSV, Markdown and plain text
|
|
17
|
+
into clean Markdown.
|
|
18
|
+
- Selectable PDF backends: `Pymu` (default, local and fast), `Docling` (local
|
|
19
|
+
layout-aware ML pipeline), `Mistral` (cloud OCR) and `Llama` (LlamaCloud).
|
|
20
|
+
- `parse_with_images()` extracts images alongside the Markdown, with anchors
|
|
21
|
+
kept at their position in the text. Images are described either by a VLM or
|
|
22
|
+
by Mistral OCR annotations in the same call.
|
|
23
|
+
- `parse_pdfs()` parses many PDFs in one batch job through the Mistral Batch
|
|
24
|
+
API, falling back to a per-file loop on backends without batch support.
|
|
25
|
+
- `chunk()` splits Markdown into chunks carrying their heading hierarchy in
|
|
26
|
+
`section_path`.
|
|
27
|
+
- Cost helpers: `cost_per_1k_pages()` and `estimate_cost()`, usable without
|
|
28
|
+
instantiating a backend.
|
|
29
|
+
- Backend protocols (`Backend`, `ImageBackend`, `BatchBackend`,
|
|
30
|
+
`DocxImageBackend`, `PptxImageBackend`) so third-party backends can plug in.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
These matter only if you were installing the package straight from git before
|
|
35
|
+
this release.
|
|
36
|
+
|
|
37
|
+
- `LlamaTier` is a `Literal` of the four accepted tiers rather than a bare
|
|
38
|
+
`str`, and is defined once alongside the pricing table.
|
|
39
|
+
- `zip()` calls over sequences that must line up now use `strict=True`: a length
|
|
40
|
+
mismatch raises instead of silently truncating.
|
|
41
|
+
- `parse_with_images(backend=...)` accepts DOCX- and PPTX-capable backends in
|
|
42
|
+
its type signature, matching what the function already supported at runtime.
|
|
43
|
+
|
|
44
|
+
[Unreleased]: https://gitlab.com/deepika6190303/deepika-open-toolbox/dot-parser/-/compare/v2.0.0...main
|
|
45
|
+
[2.0.0]: https://gitlab.com/deepika6190303/deepika-open-toolbox/dot-parser/-/tags/v2.0.0
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in this project. Contributions are welcome.
|
|
4
|
+
|
|
5
|
+
This project is maintained by **Kannon For Deep Tech** and released under the
|
|
6
|
+
GNU Affero General Public License v3.0 or later (`AGPL-3.0-or-later`).
|
|
7
|
+
|
|
8
|
+
## 1. Sign off your commits (DCO)
|
|
9
|
+
|
|
10
|
+
Every commit must carry a `Signed-off-by` line. Add it automatically with:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
git commit -s
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This appends:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Signed-off-by: Jane Doe <jane@example.com>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The name and email must be your real ones and must match your commit author
|
|
23
|
+
details. By signing off, you certify the [Developer Certificate of Origin](DCO)
|
|
24
|
+
(v1.1) **and** you agree to the licensing terms in section 2 below.
|
|
25
|
+
|
|
26
|
+
Pull requests with unsigned commits will not be merged.
|
|
27
|
+
|
|
28
|
+
## 2. Licensing of your contribution
|
|
29
|
+
|
|
30
|
+
By contributing to this project, you agree to the following.
|
|
31
|
+
|
|
32
|
+
**2.1 — Outbound licence.** Your contribution is licensed to the public under
|
|
33
|
+
`AGPL-3.0-or-later`, the same terms as the rest of the project.
|
|
34
|
+
|
|
35
|
+
**2.2 — Additional grant to the maintainer.** You additionally grant Kannon For
|
|
36
|
+
Deep Tech a perpetual, worldwide, irrevocable, non-exclusive, royalty-free,
|
|
37
|
+
transferable and sublicensable right to reproduce, modify, adapt, translate,
|
|
38
|
+
publish, distribute and otherwise exploit your contribution, in whole or in
|
|
39
|
+
part, in any form and by any means, on any medium, **under any licensing terms,
|
|
40
|
+
including proprietary and commercial terms**, for the entire duration of the
|
|
41
|
+
applicable copyright protection and worldwide.
|
|
42
|
+
|
|
43
|
+
**2.3 — What this means in practice.** This project is dual-licensed: it is
|
|
44
|
+
available to everyone under the AGPL, and Kannon For Deep Tech also sells
|
|
45
|
+
commercial licences to organisations that cannot comply with the AGPL. Section
|
|
46
|
+
2.2 is what makes that possible. Without it, no contribution could be included
|
|
47
|
+
in a commercially licensed version.
|
|
48
|
+
|
|
49
|
+
**2.4 — You keep your copyright.** This is a licence grant, not a transfer of
|
|
50
|
+
ownership. You remain the author and copyright holder of your contribution and
|
|
51
|
+
stay free to use and relicense it however you wish, elsewhere.
|
|
52
|
+
|
|
53
|
+
**2.5 — Your warranties.** You confirm that you are entitled to grant the above
|
|
54
|
+
rights, that your contribution is your original work or that you hold the
|
|
55
|
+
necessary rights over it, and that it does not infringe any third-party rights.
|
|
56
|
+
If you are contributing in the course of your employment or under a service
|
|
57
|
+
agreement, you confirm that your employer or client has authorised you to
|
|
58
|
+
contribute under these terms, or has waived any rights that would conflict with
|
|
59
|
+
them.
|
|
60
|
+
|
|
61
|
+
## 3. Contractors and employees of Kannon For Deep Tech
|
|
62
|
+
|
|
63
|
+
If you are working for Kannon For Deep Tech as an employee or under a service
|
|
64
|
+
agreement, the assignment of rights set out in your contract governs, and takes
|
|
65
|
+
precedence over this file. The sign-off above does not replace it.
|
|
66
|
+
|
|
67
|
+
## 4. Submitting a change
|
|
68
|
+
|
|
69
|
+
1. Open an issue first for anything substantial, so we can agree on the approach.
|
|
70
|
+
2. Fork, branch, and keep commits focused.
|
|
71
|
+
3. Add or update tests where relevant.
|
|
72
|
+
4. Add the SPDX headers to any new file:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
# SPDX-FileCopyrightText: Kannon For Deep Tech and contributors
|
|
76
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Do not modify the copyright lines of existing files. If you would like to be
|
|
80
|
+
credited individually, add yourself to [AUTHORS.md](AUTHORS.md) in the same pull request.
|
|
81
|
+
|
|
82
|
+
5. Sign off every commit (`git commit -s`) and open a pull request.
|
|
83
|
+
|
|
84
|
+
## 5. Questions
|
|
85
|
+
|
|
86
|
+
For anything about licensing, including commercial licences, contact
|
|
87
|
+
<louis.letarnec@deepika.ai>.
|
dot_parser-2.0.0/DCO
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Developer Certificate of Origin
|
|
2
|
+
Version 1.1
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
|
5
|
+
|
|
6
|
+
Everyone is permitted to copy and distribute verbatim copies of this
|
|
7
|
+
license document, but changing it is not allowed.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Developer's Certificate of Origin 1.1
|
|
11
|
+
|
|
12
|
+
By making a contribution to this project, I certify that:
|
|
13
|
+
|
|
14
|
+
(a) The contribution was created in whole or in part by me and I
|
|
15
|
+
have the right to submit it under the open source license
|
|
16
|
+
indicated in the file; or
|
|
17
|
+
|
|
18
|
+
(b) The contribution is based upon previous work that, to the best
|
|
19
|
+
of my knowledge, is covered under an appropriate open source
|
|
20
|
+
license and I have the right under that license to submit that
|
|
21
|
+
work with modifications, whether created in whole or in part
|
|
22
|
+
by me, under the same open source license (unless I am
|
|
23
|
+
permitted to submit under a different license), as indicated
|
|
24
|
+
in the file; or
|
|
25
|
+
|
|
26
|
+
(c) The contribution was provided directly to me by some other
|
|
27
|
+
person who certified (a), (b) or (c) and I have not modified
|
|
28
|
+
it.
|
|
29
|
+
|
|
30
|
+
(d) I understand and agree that this project and the contribution
|
|
31
|
+
are public and that a record of the contribution (including all
|
|
32
|
+
personal information I submit with it, including my sign-off) is
|
|
33
|
+
maintained indefinitely and may be redistributed consistent with
|
|
34
|
+
this project or the open source license(s) involved.
|