natural-pdf 0.1.35__py3-none-any.whl → 0.1.37__py3-none-any.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.
- natural_pdf/analyzers/__init__.py +16 -4
- natural_pdf/analyzers/guides.py +1053 -26
- natural_pdf/core/page.py +205 -45
- natural_pdf/core/pdf.py +16 -1
- natural_pdf/elements/collections.py +10 -0
- natural_pdf/elements/region.py +106 -14
- natural_pdf/elements/text.py +36 -2
- natural_pdf/flows/region.py +128 -26
- natural_pdf/selectors/parser.py +24 -0
- natural_pdf/utils/layout.py +26 -0
- natural_pdf/utils/text_extraction.py +76 -1
- {natural_pdf-0.1.35.dist-info → natural_pdf-0.1.37.dist-info}/METADATA +2 -1
- {natural_pdf-0.1.35.dist-info → natural_pdf-0.1.37.dist-info}/RECORD +17 -16
- {natural_pdf-0.1.35.dist-info → natural_pdf-0.1.37.dist-info}/WHEEL +0 -0
- {natural_pdf-0.1.35.dist-info → natural_pdf-0.1.37.dist-info}/entry_points.txt +0 -0
- {natural_pdf-0.1.35.dist-info → natural_pdf-0.1.37.dist-info}/licenses/LICENSE +0 -0
- {natural_pdf-0.1.35.dist-info → natural_pdf-0.1.37.dist-info}/top_level.txt +0 -0
@@ -2,17 +2,29 @@
|
|
2
2
|
Analyzers for natural_pdf.
|
3
3
|
"""
|
4
4
|
|
5
|
+
# Import these directly as they don't depend on Region
|
5
6
|
from natural_pdf.analyzers.guides import Guides
|
6
|
-
from natural_pdf.analyzers.layout.layout_analyzer import LayoutAnalyzer
|
7
|
-
from natural_pdf.analyzers.layout.layout_manager import LayoutManager
|
8
|
-
from natural_pdf.analyzers.layout.layout_options import LayoutOptions
|
9
7
|
from natural_pdf.analyzers.shape_detection_mixin import ShapeDetectionMixin
|
10
8
|
from natural_pdf.analyzers.text_options import TextStyleOptions
|
11
9
|
from natural_pdf.analyzers.text_structure import TextStyleAnalyzer
|
12
10
|
|
11
|
+
# Lazy imports to avoid circular dependencies
|
12
|
+
# These will be imported when actually accessed
|
13
|
+
def __getattr__(name):
|
14
|
+
if name == "LayoutAnalyzer":
|
15
|
+
from natural_pdf.analyzers.layout.layout_analyzer import LayoutAnalyzer
|
16
|
+
return LayoutAnalyzer
|
17
|
+
elif name == "LayoutManager":
|
18
|
+
from natural_pdf.analyzers.layout.layout_manager import LayoutManager
|
19
|
+
return LayoutManager
|
20
|
+
elif name == "LayoutOptions":
|
21
|
+
from natural_pdf.analyzers.layout.layout_options import LayoutOptions
|
22
|
+
return LayoutOptions
|
23
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
24
|
+
|
13
25
|
__all__ = [
|
14
26
|
"LayoutAnalyzer",
|
15
|
-
"LayoutManager",
|
27
|
+
"LayoutManager",
|
16
28
|
"LayoutOptions",
|
17
29
|
"ShapeDetectionMixin",
|
18
30
|
"TextStyleOptions",
|