pgx-docling-parser-core 0.0.0.dev0__tar.gz → 0.1.10__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.
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.4
2
+ Name: pgx-docling-parser-core
3
+ Version: 0.1.10
4
+ Summary: Core classes for paperless-docling-parser
5
+ Project-URL: Homepage, https://github.com/T-Eberle/paperless-docling-parser
6
+ Project-URL: Issues, https://github.com/T-Eberle/paperless-docling-parser/issues
7
+ Author: T-Eberle
8
+ License-Expression: MIT
9
+ Keywords: docling,paperless,paperless-ngx,pdf
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Framework :: Django
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Communications :: Email
18
+ Classifier: Topic :: Office/Business
19
+ Requires-Python: <3.14,>=3.10
20
+ Requires-Dist: docling-core>=2.0.0
21
+ Requires-Dist: pillow>=10.0.0
22
+ Requires-Dist: pymupdf>=1.23.0
23
+ Description-Content-Type: text/markdown
24
+
25
+ # pgx-docling-parser-core
26
+
27
+ Core classes and base functionality for pgx-docling-parser.
28
+
29
+ This is an internal package used by both `pgx-docling-parser-local` and `pgx-docling-parser-serve`. It is not intended to be installed directly.
30
+
31
+ ## Contents
32
+
33
+ - Base converter classes
34
+ - Common utilities
35
+ - Shared types and enums
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.24"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "pgx-docling-parser-core"
7
+ version = "0.1.10"
8
+ description = "Core classes for paperless-docling-parser"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10,<3.14"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "T-Eberle" },
14
+ ]
15
+ keywords = ["paperless", "paperless-ngx", "docling", "pdf"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Framework :: Django",
19
+ "Intended Audience :: System Administrators",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: POSIX :: Linux",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Topic :: Communications :: Email",
25
+ "Topic :: Office/Business",
26
+ ]
27
+
28
+
29
+ # Core dependencies needed by both local and docling_serve
30
+ dependencies = [
31
+ "pymupdf>=1.23.0",
32
+ "docling-core>=2.0.0",
33
+ "Pillow>=10.0.0",
34
+ ]
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/T-Eberle/paperless-docling-parser"
38
+ Issues = "https://github.com/T-Eberle/paperless-docling-parser/issues"
39
+
40
+ [tool.hatch.build.targets.wheel]
41
+ packages = ["src/pgx_docling"]
42
+
43
+ [tool.hatch.build.targets.sdist]
44
+ include = [
45
+ "src/",
46
+ ]
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from pathlib import Path
4
- from core.base import BaseDoclingConverter, PdfConversionMode, get_pdf_conversion_mode
4
+ from pgx_docling.base import BaseDoclingConverter, PdfConversionMode, get_pdf_conversion_mode
5
5
 
6
6
  # Read version from VERSION file at repository root
7
7
  _version_file = Path(__file__).parent.parent.parent.parent.parent / "VERSION"
@@ -12,6 +12,8 @@ from typing import TYPE_CHECKING
12
12
 
13
13
  from docling_core.types.doc.document import DoclingDocument
14
14
 
15
+ from pgx_docling.base import BaseDoclingConverter
16
+
15
17
  # Configure logging
16
18
  logger = logging.getLogger(__name__)
17
19
 
@@ -79,12 +81,14 @@ class DoclingParser:
79
81
  return False
80
82
 
81
83
 
82
- def __init__(self, logging_group: object = None) -> None:
84
+ def __init__(self, logging_group: object = None, converter: BaseDoclingConverter | None = None) -> None:
83
85
  logger.info("Initializing DoclingParser")
84
86
  self._tempdir = _make_tempdir()
85
87
  self._text: str | None = None
86
88
  self._archive_path: Path | None = None
87
- self.converter = DoclingRemoteConverter()
89
+ if converter is None:
90
+ raise ValueError("converter parameter is required")
91
+ self.converter = converter
88
92
  logger.debug(f"DoclingParser initialized with temp directory: {self._tempdir}")
89
93
 
90
94
  def __enter__(self) -> Self:
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pgx-docling-parser-core
3
- Version: 0.0.0.dev0
4
- Summary: Core classes for paperless-docling-parser
5
- Author: T-Eberle
6
- License-Expression: MIT
7
- Requires-Python: <3.14,>=3.10
8
- Requires-Dist: docling-core>=2.0.0
9
- Description-Content-Type: text/markdown
10
-
11
- # pgx-docling-parser-core
12
-
13
- Core classes and base functionality for pgx-docling-parser.
14
-
15
- This is an internal package used by both `pgx-docling-parser-local` and `pgx-docling-parser-serve`. It is not intended to be installed directly.
16
-
17
- ## Contents
18
-
19
- - Base converter classes
20
- - Common utilities
21
- - Shared types and enums
@@ -1,32 +0,0 @@
1
- [build-system]
2
- requires = ["hatchling>=1.24", "hatch-vcs>=0.3.0"]
3
- build-backend = "hatchling.build"
4
-
5
- [project]
6
- name = "pgx-docling-parser-core"
7
- dynamic = ["version"]
8
- description = "Core classes for paperless-docling-parser"
9
- readme = "README.md"
10
- requires-python = ">=3.10,<3.14"
11
- license = "MIT"
12
- authors = [
13
- { name = "T-Eberle" },
14
- ]
15
-
16
- # Core dependencies needed by both local and docling_serve
17
- dependencies = [
18
- "docling-core>=2.0.0",
19
- ]
20
-
21
- [tool.hatch.build.targets.wheel]
22
- packages = ["src/core"]
23
-
24
- [tool.hatch.version]
25
- source = "vcs"
26
- root = "../.."
27
- fallback-version = "0.0.0.dev0"
28
-
29
- [tool.hatch.build.targets.sdist]
30
- include = [
31
- "src/",
32
- ]