natural-pdf 0.1.12__py3-none-any.whl → 0.1.14__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/shape_detection_mixin.py +1373 -0
- natural_pdf/classification/manager.py +2 -3
- natural_pdf/collections/pdf_collection.py +19 -39
- natural_pdf/core/highlighting_service.py +29 -38
- natural_pdf/core/page.py +284 -187
- natural_pdf/core/pdf.py +4 -4
- natural_pdf/elements/base.py +54 -20
- natural_pdf/elements/collections.py +160 -9
- natural_pdf/elements/line.py +5 -0
- natural_pdf/elements/region.py +380 -38
- natural_pdf/exporters/paddleocr.py +51 -11
- natural_pdf/flows/__init__.py +12 -0
- natural_pdf/flows/collections.py +533 -0
- natural_pdf/flows/element.py +382 -0
- natural_pdf/flows/flow.py +216 -0
- natural_pdf/flows/region.py +458 -0
- natural_pdf/selectors/parser.py +163 -8
- {natural_pdf-0.1.12.dist-info → natural_pdf-0.1.14.dist-info}/METADATA +2 -1
- {natural_pdf-0.1.12.dist-info → natural_pdf-0.1.14.dist-info}/RECORD +22 -17
- {natural_pdf-0.1.12.dist-info → natural_pdf-0.1.14.dist-info}/WHEEL +1 -1
- natural_pdf/utils/tqdm_utils.py +0 -51
- {natural_pdf-0.1.12.dist-info → natural_pdf-0.1.14.dist-info}/licenses/LICENSE +0 -0
- {natural_pdf-0.1.12.dist-info → natural_pdf-0.1.14.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,6 @@
|
|
1
1
|
natural_pdf/__init__.py,sha256=0sCYgb9BAV5OnpD_1AswMuOLuXNmpe3OLJpv_6p3tgw,2449
|
2
2
|
natural_pdf/analyzers/__init__.py,sha256=dIXjsMqoxKmd9OOnSBzn12wvdIz7D7YNQRAnXslpJSM,142
|
3
|
+
natural_pdf/analyzers/shape_detection_mixin.py,sha256=6IXKuifC2QDurW8_gMakZCetTHSdOUK5Ye_B-P4EQMA,75381
|
3
4
|
natural_pdf/analyzers/text_options.py,sha256=qEkDaYWla0rIM_gszEOsu52q7C_dAfV81P2HLJZM2sw,3333
|
4
5
|
natural_pdf/analyzers/text_structure.py,sha256=VfKTsTFrK877sC0grsis9jK3rrgp0Mbp13VWEbukTcs,28437
|
5
6
|
natural_pdf/analyzers/utils.py,sha256=PYbzJzSAHZ7JsMes84WIrSbA0zkjJGs0CLvIeINsf_k,2100
|
@@ -15,22 +16,22 @@ natural_pdf/analyzers/layout/pdfplumber_table_finder.py,sha256=Tk0Q7wv7nGYPo69lh
|
|
15
16
|
natural_pdf/analyzers/layout/surya.py,sha256=4RdnhRxSS3i3Ns5mFhOA9-P0xd7Ms19uZuKvUGQfEBI,9789
|
16
17
|
natural_pdf/analyzers/layout/tatr.py,sha256=cVr0ZyhY2mNLAKZ4DGMm-b7XNJpILKh8x8ZpyDeUhLk,15032
|
17
18
|
natural_pdf/analyzers/layout/yolo.py,sha256=ANo2U4EZgeN2eYKM1bZIuysiuJLgwl4JeQchrRxOKwA,8388
|
18
|
-
natural_pdf/classification/manager.py,sha256
|
19
|
+
natural_pdf/classification/manager.py,sha256=-rdZzGP_JK4RDDxIEgdY8_gHRNS0cNHhpOSodjxbd84,17853
|
19
20
|
natural_pdf/classification/mixin.py,sha256=hhX9qWPShpOq_-mgoEq0GUWnutBnNMo3YdUlxwyNWMA,6781
|
20
21
|
natural_pdf/classification/results.py,sha256=El1dY7cBQVOB5lP-uj52dWgH6Y7TeQgJOVcZD-OLjes,2778
|
21
22
|
natural_pdf/collections/mixins.py,sha256=sj76Cn6EdBtb5f-bdAV-1qpdixX8tI4BzPccPiYLI1w,5117
|
22
|
-
natural_pdf/collections/pdf_collection.py,sha256=
|
23
|
+
natural_pdf/collections/pdf_collection.py,sha256=nsbrzcsXAD2qVLLXhDYpljAb_WnjMNanHJ6J7UtYzGA,31165
|
23
24
|
natural_pdf/core/__init__.py,sha256=QC8H4M3KbXwMFiQORZ0pdPlzx1Ix6oKKQSS7Ib2KEaA,38
|
24
25
|
natural_pdf/core/element_manager.py,sha256=_UdXu51sLi6STzc8Pj4k8R721G3yJixXDLuRHn3hmr8,25731
|
25
|
-
natural_pdf/core/highlighting_service.py,sha256=
|
26
|
-
natural_pdf/core/page.py,sha256=
|
27
|
-
natural_pdf/core/pdf.py,sha256=
|
26
|
+
natural_pdf/core/highlighting_service.py,sha256=tjMJpdJj2oaMGpdqiNHPcTJqID4nd-uBZ5v7KtPmoc0,36762
|
27
|
+
natural_pdf/core/page.py,sha256=hg7EoYMbvgo9dXivBl6xb6dENobhSHt0Wuu36O5J900,111119
|
28
|
+
natural_pdf/core/pdf.py,sha256=395aBTg4Le4vABvQWgBhPm669nGJ8JdMToTs1UtQ2Vg,69575
|
28
29
|
natural_pdf/elements/__init__.py,sha256=S8XeiNWJ1WcgnyYKdYV1yxQlAxCCO3FfITT8MQwNbyk,41
|
29
|
-
natural_pdf/elements/base.py,sha256=
|
30
|
-
natural_pdf/elements/collections.py,sha256=
|
31
|
-
natural_pdf/elements/line.py,sha256=
|
30
|
+
natural_pdf/elements/base.py,sha256=NNF-iUzkip0UgfKTuqLE1jVJsq2yD7LUTvOQWMi_Jpc,39631
|
31
|
+
natural_pdf/elements/collections.py,sha256=qd58tD3f-eojz90ICytlqu4Ej0OQoWgsxV4umQDhUvA,120809
|
32
|
+
natural_pdf/elements/line.py,sha256=300kSFBDUBIudfeQtH_tzW9gTYRgRKUDPiTABw6J-BE,4782
|
32
33
|
natural_pdf/elements/rect.py,sha256=kiVa3e377ZnqIOXc89d9ZSY4EcmDxtccdtUw-HOQzpw,3796
|
33
|
-
natural_pdf/elements/region.py,sha256=
|
34
|
+
natural_pdf/elements/region.py,sha256=wBBAcuudRqL1b9ojLdrXiwUIcQbTWEWTky_RbBuCgnU,115798
|
34
35
|
natural_pdf/elements/text.py,sha256=13HvVZGinj2Vm_fFCAnqi7hohtoKvnpCp3VCfkpeAbc,11146
|
35
36
|
natural_pdf/export/mixin.py,sha256=L1q3MIEFWuvie4j4_EmW7GT3NerbZ1as0XMUoqTS7gM,5083
|
36
37
|
natural_pdf/exporters/__init__.py,sha256=7MnvRLLQdwtg-ULu-8uK8C84GsKiJamyhRw_GgWhw7k,151
|
@@ -38,7 +39,7 @@ natural_pdf/exporters/base.py,sha256=XhR1xlkHOh7suOuX7mWbsj1h2o1pZNet-OAS5YCJyeI
|
|
38
39
|
natural_pdf/exporters/hocr.py,sha256=MOb5sTxe-GlMSOtmqp3p4SY_ZigwOtmd4sj_zMRCIQY,19907
|
39
40
|
natural_pdf/exporters/hocr_font.py,sha256=1wsGOMj6zoaRN2rxCwrv4MMLGawpNz984WgXpmWekgw,4574
|
40
41
|
natural_pdf/exporters/original_pdf.py,sha256=zsZPg_lUoEerKIzzoEw-qGdM5XBg_LZhFJeVKnCUp4o,5054
|
41
|
-
natural_pdf/exporters/paddleocr.py,sha256=
|
42
|
+
natural_pdf/exporters/paddleocr.py,sha256=srwk_N10wVqtEU5bI8B3XGfXr54gaaJ0Q5zpq4-cSVY,18361
|
42
43
|
natural_pdf/exporters/searchable_pdf.py,sha256=G2Tc4tpDXSYIufXJlkA8ppW_3DuzHAaweYKae33pI_c,16290
|
43
44
|
natural_pdf/exporters/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
45
|
natural_pdf/exporters/data/pdf.ttf,sha256=x4RUIJJaI9iO2DCmOVe4r4Wmao2vjZ_JDoQ2c7LvGlk,572
|
@@ -46,6 +47,11 @@ natural_pdf/exporters/data/sRGB.icc,sha256=KpLUuuRQt22LCqQhk9-XTXX2Jzjs6_dPAcXnW
|
|
46
47
|
natural_pdf/extraction/manager.py,sha256=mUBbfgLG5Pl31wmajXwyipdEJb_dZ5I-y8GnWw7IzGo,4969
|
47
48
|
natural_pdf/extraction/mixin.py,sha256=eKbr70VibpbtfjvCE80lTFuYHzq_BoVtOHjznL_GMRA,11719
|
48
49
|
natural_pdf/extraction/result.py,sha256=c1vLguCR6l95cvg-BJJmZvL_MPg2McJaczge55bKZMg,934
|
50
|
+
natural_pdf/flows/__init__.py,sha256=82ibI0eNJfVergEsTyom9Nxe_T6pnWQsr4-CISGQlz0,277
|
51
|
+
natural_pdf/flows/collections.py,sha256=iOmRqM5K74kqioh7-UAbNgkpXMr9nkZZ5oW4_sQ1Alo,26433
|
52
|
+
natural_pdf/flows/element.py,sha256=HMlSBjnQH3CF89wDwc0qBpAfmMmHHK_5LeY1TYeqtTs,20564
|
53
|
+
natural_pdf/flows/flow.py,sha256=ft07Ou0uRodF_gTgumVlU9YUquE3LTZz5LEAoQGErEs,10375
|
54
|
+
natural_pdf/flows/region.py,sha256=5xAnePZjs292oKrGG5El3pwhpxaHQYLzse35ilswhqI,21298
|
49
55
|
natural_pdf/ocr/__init__.py,sha256=VY8hhvDPf7Gh2lB-d2QRmghLLyTy6ydxlgo1cS4dOSk,2482
|
50
56
|
natural_pdf/ocr/engine.py,sha256=ZBC1tZNM5EDbGDJJmZI9mNHr4nCMLEZvUFhiJq8GdF4,8741
|
51
57
|
natural_pdf/ocr/engine_doctr.py,sha256=519WpvSHgwP6Hv24tci_YHFX7XPlaxOnlREN_YG-Yys,16331
|
@@ -65,7 +71,7 @@ natural_pdf/search/search_options.py,sha256=sq_e8_jSROicD94b_xtDtLnjEr_Zsy4icjzP
|
|
65
71
|
natural_pdf/search/search_service_protocol.py,sha256=Dl-Q-CrutkhZwI69scbW9EWPeYM63qxB60_EA7YqIYo,6699
|
66
72
|
natural_pdf/search/searchable_mixin.py,sha256=dZbaHv8Go3TJNqxoPtnp9Dr0Ftxuf_44RpBeIRXkPxc,23534
|
67
73
|
natural_pdf/selectors/__init__.py,sha256=oZGeqSv53EqmIZOhcnawuaGGlRg1h79vArXuZCWKm4A,123
|
68
|
-
natural_pdf/selectors/parser.py,sha256=
|
74
|
+
natural_pdf/selectors/parser.py,sha256=EZsNRjn40qjiQ-KlQOmGJVrkvlVd8wez9v3SGdoFYSo,30226
|
69
75
|
natural_pdf/templates/__init__.py,sha256=jYBxzfi73vew0f6yhIh1MlRxw4F_TVN2hKQR0YXOFe0,20
|
70
76
|
natural_pdf/utils/__init__.py,sha256=s3M8FggaK1P3EBYn6R_-HgSDjNc9C73gyKe1hihtNWg,43
|
71
77
|
natural_pdf/utils/debug.py,sha256=RN7H3E6ph-GtxubCW6psW7TO8o2BxcNLiEzByTVR9fk,995
|
@@ -75,12 +81,11 @@ natural_pdf/utils/locks.py,sha256=7HJqV0VsNcOfISnbw8goCKWP5ck11uSJo6T_x9XIPKI,21
|
|
75
81
|
natural_pdf/utils/packaging.py,sha256=Jshxp6S1zfcqoZmFhdd7WOpL--b6rBSz-Y9mYqELXIY,21581
|
76
82
|
natural_pdf/utils/reading_order.py,sha256=s3DsYq_3g_1YA07qhd4BGEjeIRTeyGtnwc_hNtSzwBY,7290
|
77
83
|
natural_pdf/utils/text_extraction.py,sha256=z6Jhy11pakYCsEpkvh8ldw6DkUFsYF1hCL9YDmfXWL4,9605
|
78
|
-
natural_pdf/utils/tqdm_utils.py,sha256=wV3RXvqog26eWEFEqjt2LkGnLswmO1GXaVGSqgS7tAY,1601
|
79
84
|
natural_pdf/utils/visualization.py,sha256=30pRWQdsRJh2pSObh-brKVsFgC1n8tHmSrta_UDnVPw,8989
|
80
85
|
natural_pdf/widgets/__init__.py,sha256=O2fSDo604wDAP6UwUkmBq3eT91RSqHwBpAOQXq92S8s,214
|
81
86
|
natural_pdf/widgets/viewer.py,sha256=ekgXTEfA48GrR-JjpCpgyBCXdf4IubV0pAXDJozcU7A,39196
|
82
|
-
natural_pdf-0.1.
|
83
|
-
natural_pdf-0.1.
|
84
|
-
natural_pdf-0.1.
|
85
|
-
natural_pdf-0.1.
|
86
|
-
natural_pdf-0.1.
|
87
|
+
natural_pdf-0.1.14.dist-info/licenses/LICENSE,sha256=9zfwINwJlarbDmdh6iJV4QUG54QSJlSAUcnC1YiC_Ns,1074
|
88
|
+
natural_pdf-0.1.14.dist-info/METADATA,sha256=NzaR_hcSyFH22knKZ-NMCct_XOo2nPUk83XHspTncyE,7674
|
89
|
+
natural_pdf-0.1.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
90
|
+
natural_pdf-0.1.14.dist-info/top_level.txt,sha256=Cyw1zmNDlUZfb5moU-WUWGprrwH7ln_8LDGdmMHF1xI,17
|
91
|
+
natural_pdf-0.1.14.dist-info/RECORD,,
|
natural_pdf/utils/tqdm_utils.py
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
import sys
|
3
|
-
|
4
|
-
# Default to standard tqdm
|
5
|
-
try:
|
6
|
-
from tqdm.std import tqdm as selected_tqdm
|
7
|
-
except ImportError:
|
8
|
-
# Basic fallback if even std is missing (though unlikely)
|
9
|
-
def selected_tqdm(*args, **kwargs):
|
10
|
-
iterable = args[0] if args else None
|
11
|
-
if iterable:
|
12
|
-
return iterable
|
13
|
-
return None # Simple passthrough if no iterable
|
14
|
-
|
15
|
-
|
16
|
-
# Try to detect notebook environment
|
17
|
-
try:
|
18
|
-
# Check 1: Are we running in an IPython kernel?
|
19
|
-
from IPython import get_ipython
|
20
|
-
|
21
|
-
ipython = get_ipython()
|
22
|
-
if ipython and "IPKernelApp" in ipython.config:
|
23
|
-
# Check 2: Is it likely a notebook UI (Jupyter Notebook/Lab, VSCode, etc.)?
|
24
|
-
# This checks for common indicators. Might not be foolproof.
|
25
|
-
if "VSCODE_PID" in os.environ or (
|
26
|
-
"ipykernel" in sys.modules and "spyder" not in sys.modules
|
27
|
-
):
|
28
|
-
# Check 3: Can we import notebook version?
|
29
|
-
try:
|
30
|
-
from tqdm.notebook import tqdm as notebook_tqdm
|
31
|
-
|
32
|
-
selected_tqdm = notebook_tqdm # Use notebook version
|
33
|
-
except ImportError:
|
34
|
-
pass # Stick with std if notebook version missing
|
35
|
-
except ImportError:
|
36
|
-
pass # Stick with std if IPython not available
|
37
|
-
|
38
|
-
|
39
|
-
def get_tqdm():
|
40
|
-
"""Returns the tqdm class best suited for the detected environment."""
|
41
|
-
return selected_tqdm
|
42
|
-
|
43
|
-
|
44
|
-
# Example usage (for testing):
|
45
|
-
if __name__ == "__main__":
|
46
|
-
import time
|
47
|
-
|
48
|
-
tqdm_instance = get_tqdm()
|
49
|
-
print(f"Using tqdm class: {tqdm_instance}")
|
50
|
-
for i in tqdm_instance(range(10), desc="Testing tqdm"):
|
51
|
-
time.sleep(0.1)
|
File without changes
|
File without changes
|