bulkparse 0.1.0__cp310-abi3-win_amd64.whl
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.
- bulkparse/__init__.py +136 -0
- bulkparse/_native.pyd +0 -0
- bulkparse/py.typed +1 -0
- bulkparse-0.1.0.dist-info/METADATA +63 -0
- bulkparse-0.1.0.dist-info/RECORD +9 -0
- bulkparse-0.1.0.dist-info/WHEEL +4 -0
- bulkparse-0.1.0.dist-info/licenses/LICENSE +21 -0
- bulkparse-0.1.0.dist-info/licenses/THIRD_PARTY_NOTICES.md +115 -0
- bulkparse-0.1.0.dist-info/licenses/licenses/Apache-2.0.txt +201 -0
bulkparse/__init__.py
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"""Thin Python interface to the same Rust engine used by Bulkgrid."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any
|
|
6
|
+
from . import _native
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BulkParseError(Exception):
|
|
10
|
+
def __init__(self, code: str, message: str):
|
|
11
|
+
super().__init__(message)
|
|
12
|
+
self.code = code
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def parse(data: bytes, *, filename: str | None = None, **options: Any) -> dict[str, Any]:
|
|
16
|
+
"""Convert bytes into the shared JSON model and Markdown. No code is executed."""
|
|
17
|
+
return _run(data, filename, options, False)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def inspect_pdf(data: bytes, **options: Any) -> dict[str, Any]:
|
|
21
|
+
"""Inspect every PDF page without running OCR or reconstructing layout."""
|
|
22
|
+
return _run(data, None, options, True)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _run(data, filename, options, inspect):
|
|
26
|
+
if not isinstance(data, (bytes, bytearray)):
|
|
27
|
+
raise TypeError("data must be bytes or bytearray")
|
|
28
|
+
cap = options.get("limits", {}).get("max_input_bytes", 33554432)
|
|
29
|
+
if not isinstance(cap, int) or isinstance(cap, bool) or cap < 0:
|
|
30
|
+
raise ValueError("max_input_bytes must be a nonnegative integer")
|
|
31
|
+
if len(data) > cap:
|
|
32
|
+
raise BulkParseError("resource_limit", "resource limit exceeded: max_input_bytes")
|
|
33
|
+
try:
|
|
34
|
+
return json.loads(_native.inspect_pdf_json(bytes(data), json.dumps(options)) if inspect else _native.parse_json(bytes(data), filename, json.dumps(options)))
|
|
35
|
+
except ValueError as error:
|
|
36
|
+
try:
|
|
37
|
+
detail = json.loads(str(error))
|
|
38
|
+
except (ValueError, TypeError):
|
|
39
|
+
raise error
|
|
40
|
+
raise BulkParseError(detail["code"], detail["message"]) from error
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def parse_file(path: str | Path, **options: Any) -> dict[str, Any]:
|
|
44
|
+
path = Path(path)
|
|
45
|
+
cap = options.get("limits", {}).get("max_input_bytes", 33554432)
|
|
46
|
+
if not isinstance(cap, int) or isinstance(cap, bool) or cap < 0:
|
|
47
|
+
raise ValueError("max_input_bytes must be a nonnegative integer")
|
|
48
|
+
with path.open("rb") as file:
|
|
49
|
+
data = file.read(cap + 1)
|
|
50
|
+
filename = options.pop("filename", path.name)
|
|
51
|
+
return parse(data, filename=filename, **options)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def capabilities() -> list[dict[str, Any]]:
|
|
55
|
+
return json.loads(_native.capabilities_json())
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def parse_file_to_markdown(input: str | Path, output: str | Path, **options: Any) -> dict[str, Any]:
|
|
59
|
+
"""Write Markdown without overwriting; export_images=True saves Office/EPUB assets without changing the Markdown."""
|
|
60
|
+
if "filename" in options:
|
|
61
|
+
raise ValueError("parse_file_to_markdown uses the input path")
|
|
62
|
+
try:
|
|
63
|
+
return json.loads(_native.parse_file_to_markdown_json(str(input), str(output), json.dumps(options)))
|
|
64
|
+
except ValueError as error:
|
|
65
|
+
try:
|
|
66
|
+
detail = json.loads(str(error))
|
|
67
|
+
except (ValueError, TypeError):
|
|
68
|
+
raise error
|
|
69
|
+
raise BulkParseError(detail["code"], detail["message"]) from error
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
__all__ = ["parse_file_to_markdown", "inspect_pdf", "parse", "parse_file", "capabilities", "BulkParseError"]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _ocr_call(call):
|
|
76
|
+
try:
|
|
77
|
+
return json.loads(call())
|
|
78
|
+
except ValueError as error:
|
|
79
|
+
try:
|
|
80
|
+
detail = json.loads(str(error))
|
|
81
|
+
except (ValueError, TypeError):
|
|
82
|
+
raise error
|
|
83
|
+
raise BulkParseError(detail["code"], detail["message"]) from error
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _ocr_input(data, options):
|
|
87
|
+
if not isinstance(data, (bytes, bytearray)):
|
|
88
|
+
raise TypeError("data must be bytes or bytearray")
|
|
89
|
+
cap = options.get("limits", {}).get("max_input_bytes", 33554432)
|
|
90
|
+
if not isinstance(cap, int) or isinstance(cap, bool) or cap < 0:
|
|
91
|
+
raise ValueError("max_input_bytes must be a nonnegative integer")
|
|
92
|
+
if len(data) > cap:
|
|
93
|
+
raise BulkParseError("resource_limit", "resource limit exceeded: max_input_bytes")
|
|
94
|
+
return bytes(data)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def parse_with_ocr(data: bytes, evidence: dict[str, Any], *, filename: str | None = None,
|
|
98
|
+
budget: dict[str, int] | None = None, **options: Any) -> dict[str, Any]:
|
|
99
|
+
"""Validate and assemble host-provided OCR evidence without loading an OCR engine."""
|
|
100
|
+
data = _ocr_input(data, options)
|
|
101
|
+
return _ocr_call(lambda: _native.parse_with_ocr_json(data, json.dumps(evidence), filename, json.dumps(options), json.dumps(budget or {})))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class OcrParser:
|
|
105
|
+
"""Own reusable Rust OCR models. Configuration must come from the trusted host."""
|
|
106
|
+
def __init__(self, config: dict[str, Any]):
|
|
107
|
+
try:
|
|
108
|
+
self._parser = _native.NativeOcrParser(json.dumps(config))
|
|
109
|
+
except ValueError as error:
|
|
110
|
+
detail = json.loads(str(error))
|
|
111
|
+
raise BulkParseError(detail["code"], detail["message"]) from error
|
|
112
|
+
|
|
113
|
+
def parse(self, data: bytes, *, filename: str | None = None,
|
|
114
|
+
budget: dict[str, int] | None = None, **options: Any) -> dict[str, Any]:
|
|
115
|
+
data = _ocr_input(data, options)
|
|
116
|
+
return _ocr_call(lambda: self._parser.parse_json(data, filename, json.dumps(options), json.dumps(budget or {})))
|
|
117
|
+
|
|
118
|
+
def parse_file(self, path: str | Path, *, budget: dict[str, int] | None = None, **options: Any) -> dict[str, Any]:
|
|
119
|
+
path = Path(path)
|
|
120
|
+
_ocr_input(b"", options)
|
|
121
|
+
with path.open("rb") as stream:
|
|
122
|
+
data = stream.read(options.get("limits", {}).get("max_input_bytes", 33554432) + 1)
|
|
123
|
+
filename = options.pop("filename", path.name)
|
|
124
|
+
return self.parse(data, filename=filename, budget=budget, **options)
|
|
125
|
+
|
|
126
|
+
def close(self) -> None:
|
|
127
|
+
self._parser.close()
|
|
128
|
+
|
|
129
|
+
def __enter__(self):
|
|
130
|
+
return self
|
|
131
|
+
|
|
132
|
+
def __exit__(self, *_args):
|
|
133
|
+
self.close()
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
__all__ += ["parse_with_ocr", "OcrParser"]
|
bulkparse/_native.pyd
ADDED
|
Binary file
|
bulkparse/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bulkparse
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
License-File: LICENSE
|
|
5
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
6
|
+
License-File: licenses/Apache-2.0.txt
|
|
7
|
+
Summary: Python bindings for the BulkParse Rust document engine
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
11
|
+
Project-URL: Repository, https://github.com/bulkgrid/bulkparse
|
|
12
|
+
|
|
13
|
+
# BulkParse for Python
|
|
14
|
+
|
|
15
|
+
Requires Python 3.10+. Install a prebuilt wheel with:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
python -m pip install bulkparse
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Wheels cover Linux x64/ARM64 (glibc 2.28+), macOS 11+ (Intel/Apple Silicon), and
|
|
22
|
+
Windows x64. Rust is needed only for a source build. For development from this folder:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
python3 -m venv .venv
|
|
26
|
+
source .venv/bin/activate
|
|
27
|
+
python -m pip install maturin
|
|
28
|
+
maturin develop --release
|
|
29
|
+
python -m unittest discover -s tests
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
On Windows activate the virtual environment using `.venv\Scripts\activate`.
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from bulkparse import parse, parse_file, BulkParseError
|
|
36
|
+
|
|
37
|
+
result = parse(b"# Hello", filename="hello.md")
|
|
38
|
+
print(result["markdown"])
|
|
39
|
+
document = parse_file("document.docx", strict=True)
|
|
40
|
+
print(document["document"]["blocks"])
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Calls are synchronous and release the GIL during Rust conversion. Thread pools and queue limits belong to the application. Inputs are copied into Rust memory. `BulkParseError.code` carries stable error categories (`resource_limit`, `unsupported`, `malformed`, `incomplete`, etc.). The result is a dictionary with the same schema used by Node/WASM.
|
|
44
|
+
|
|
45
|
+
`capabilities()` reports enabled formats. Options mirror the Rust core; see the root README for extraction limitations and budgets. The release pipeline tests installation from built wheels and the source archive.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
CSV supports automatic comma/semicolon/tab/pipe detection and BOM-aware UTF-8/UTF-16 decoding. Without a BOM or explicit encoding, valid UTF-8 is preserved; otherwise legacy Windows-1252 decoding is attempted and reported with a `csv_encoding_inferred` diagnostic. Encoding inference is ambiguous, particularly for mixed-encoding files. Set `csv_encoding` to `utf8` for strict UTF-8, `windows1252` for a known legacy export, or `utf16_le` / `utf16_be` for BOM-less UTF-16. Explicit encodings must agree with any BOM. Undefined Windows-1252 bytes and binary controls are rejected. For delimiter ambiguity, pass `csv_delimiter` (one ASCII character); headers remain explicit through `csv_has_headers`.
|
|
49
|
+
|
|
50
|
+
PDFs support conservative ruled-table reconstruction. Arabic presentation forms and alphabetic ligatures expand by default. Pass `pdf_normalize_unicode: false` (Python: `pdf_normalize_unicode=False`) to retain mapped forms. `ActualText` is always preserved. See the root `docs/pdf-tables.md` for limits and validation.
|
|
51
|
+
|
|
52
|
+
PDF inspection is available without an OCR runtime: `inspect_pdf(pdf_bytes)`. Conversion results also include `pdf_inspection`. The shared output schema is now 0.8. See [inspection and routing](../../docs/pdf-inspection.md).
|
|
53
|
+
|
|
54
|
+
The standard build enables BulkParse-owned Office/EPUB readers. See [format support and limits](../../docs/office-formats.md).
|
|
55
|
+
|
|
56
|
+
For resource-limited spreadsheets and CSV files, opt in to `partial_on_limit` (Python: `partial_on_limit=True`). Successful normal conversions are unchanged; supported limit failures can return an explicitly partial prefix within the original per-attempt budgets. This is not complete extraction and strict mode never accepts the recovery result. Inspect `status` and `resource_limit_partial` diagnostics. See [bounded large-document handling](../../docs/large-documents.md). Rebuild the binding to use this option.
|
|
57
|
+
|
|
58
|
+
Embedded image bytes are available in `document.assets` (base64 JSON). See [image retention, export and limitations](../../docs/images.md).
|
|
59
|
+
|
|
60
|
+
## OCR and standalone images
|
|
61
|
+
|
|
62
|
+
See [OCR across language bindings](../../docs/ocr-bindings.md) for the shared evidence API, the reusable native OCR parser, image/frame support, scanned-table limits, and examples.
|
|
63
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
bulkparse\__init__.py,sha256=7-neL7zZ4dhi3yqVvOExvEMf6brVz_Z8_aTWKAFPIzY,5581
|
|
2
|
+
bulkparse\_native.pyd,sha256=VjyrlLB5pEhcJ_GEM4HVfXZSln20ZhxamGFvEgfd-1E,9932288
|
|
3
|
+
bulkparse\py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
4
|
+
bulkparse-0.1.0.dist-info\METADATA,sha256=5qyVR39MTA51TATa6Q_cbAp3NqAdpLPGqE9BJNUebzY,4010
|
|
5
|
+
bulkparse-0.1.0.dist-info\WHEEL,sha256=ZMDDxh9OPoaLQ4P2dJmgI1XsENYSzjzq8fErKKVw5iE,96
|
|
6
|
+
bulkparse-0.1.0.dist-info\licenses\LICENSE,sha256=ABd6NGH3T5vxtPAM5pGdRsYvYfETDOm8U78fKYcvp5I,1100
|
|
7
|
+
bulkparse-0.1.0.dist-info\licenses\THIRD_PARTY_NOTICES.md,sha256=HgicaUnvJMBaoiq1-vT1YQncqHONfWNgn7kbkRM8k40,5481
|
|
8
|
+
bulkparse-0.1.0.dist-info\licenses\licenses\Apache-2.0.txt,sha256=4MOvWtITR2uxI-rnNAKK3dpIUAV4pCI5ut4Q6Y4ymX8,11548
|
|
9
|
+
bulkparse-0.1.0.dist-info\RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BulkParse contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
The following copyright and license notices must accompany distributions of the relevant material. Benchmark-only converters and separately provisioned OCR models retain their own licenses.
|
|
4
|
+
|
|
5
|
+
## PDF layout and standard font metrics
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 Firecrawl
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
## Font style classification
|
|
30
|
+
|
|
31
|
+
MIT License
|
|
32
|
+
|
|
33
|
+
Copyright The Docling Contributors
|
|
34
|
+
|
|
35
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
36
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
37
|
+
in the Software without restriction, including without limitation the rights
|
|
38
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
39
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
40
|
+
furnished to do so, subject to the following conditions:
|
|
41
|
+
|
|
42
|
+
The above copyright notice and this permission notice shall be included in all
|
|
43
|
+
copies or substantial portions of the Software.
|
|
44
|
+
|
|
45
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
46
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
47
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
48
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
49
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
50
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
51
|
+
SOFTWARE.
|
|
52
|
+
|
|
53
|
+
## Office format support
|
|
54
|
+
|
|
55
|
+
MIT License
|
|
56
|
+
|
|
57
|
+
Copyright (c) 2026 Sideguide Technologies Inc.
|
|
58
|
+
|
|
59
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
60
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
61
|
+
in the Software without restriction, including without limitation the rights
|
|
62
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
63
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
64
|
+
furnished to do so, subject to the following conditions:
|
|
65
|
+
|
|
66
|
+
The above copyright notice and this permission notice shall be included in all
|
|
67
|
+
copies or substantial portions of the Software.
|
|
68
|
+
|
|
69
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
70
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
71
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
72
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
73
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
74
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
75
|
+
SOFTWARE.
|
|
76
|
+
|
|
77
|
+
## XML parsing
|
|
78
|
+
|
|
79
|
+
The MIT License (MIT)
|
|
80
|
+
|
|
81
|
+
Copyright (c) 2016 Johann Tuffe
|
|
82
|
+
|
|
83
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
84
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
85
|
+
in the Software without restriction, including without limitation the rights
|
|
86
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
87
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
88
|
+
furnished to do so, subject to the following conditions:
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
The above copyright notice and this permission notice shall be included in
|
|
92
|
+
all copies or substantial portions of the Software.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
96
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
97
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
98
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
99
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
100
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
101
|
+
THE SOFTWARE.
|
|
102
|
+
|
|
103
|
+
## Native OCR runtime and models
|
|
104
|
+
|
|
105
|
+
The optional native OCR provider uses `oar-ocr` and `oar-ocr-core`, distributed
|
|
106
|
+
under Apache-2.0. A copy is retained in
|
|
107
|
+
[`crates/bulkparse-ocr-native/licenses/Apache-2.0.txt`](crates/bulkparse-ocr-native/licenses/Apache-2.0.txt).
|
|
108
|
+
Upstream: https://github.com/GreatV/oar-ocr.
|
|
109
|
+
|
|
110
|
+
The model provisioning manifest records the exact PaddleOCR model exports,
|
|
111
|
+
SHA-256 identities and distribution URLs. PaddleOCR is distributed under
|
|
112
|
+
Apache-2.0: https://github.com/PaddlePaddle/PaddleOCR/blob/main/LICENSE.
|
|
113
|
+
The ONNX Runtime and PDFium runtime archives retain their upstream LICENSE and
|
|
114
|
+
third-party notices in the provisioned runtime directory. These notices must
|
|
115
|
+
accompany distributions of those artifacts.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Wang Xin (GreatV)
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|