PyStreamPDF 2.2.0__tar.gz → 2.3.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.
Files changed (79) hide show
  1. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/Cargo.lock +70 -81
  2. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/Cargo.toml +1 -1
  3. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/PKG-INFO +78 -59
  4. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/README.md +77 -58
  5. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/__init__.py +3 -2
  6. pystreampdf-2.3.0/python/pystreampdf/_mcp_tools.py +537 -0
  7. pystreampdf-2.2.0/python/pystreampdf/_mcp_tools.py +0 -271
  8. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/LICENSE +0 -0
  9. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/Cargo.toml +0 -0
  10. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/audit.rs +0 -0
  11. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/context.rs +0 -0
  12. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/document.rs +0 -0
  13. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/error.rs +0 -0
  14. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/forms.rs +0 -0
  15. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/heading_extractor.rs +0 -0
  16. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/index.rs +0 -0
  17. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/lib.rs +0 -0
  18. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/markdown.rs +0 -0
  19. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/navigator.rs +0 -0
  20. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/page.rs +0 -0
  21. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/pdf_parser.rs +0 -0
  22. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/security.rs +0 -0
  23. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/core/src/structure.rs +0 -0
  24. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/pyproject.toml +0 -0
  25. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/Cargo.toml +0 -0
  26. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/_mcp_connector.py +0 -0
  27. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/cache.py +0 -0
  28. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/cli.py +0 -0
  29. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/cli_daemon.py +0 -0
  30. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/cli_dashboard.py +0 -0
  31. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/excel_export.py +0 -0
  32. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/extraction.py +0 -0
  33. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/intelligence/__init__.py +0 -0
  34. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/intelligence/code_intelligence.py +0 -0
  35. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/intelligence/json_intelligence.py +0 -0
  36. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/intelligence/log_intelligence.py +0 -0
  37. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/intelligence/sql_intelligence.py +0 -0
  38. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/intelligence/types.py +0 -0
  39. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/intelligence/yaml_intelligence.py +0 -0
  40. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/ocr/__init__.py +0 -0
  41. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/ocr/manager.py +0 -0
  42. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/ocr/pipeline.py +0 -0
  43. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/ocr/provider.py +0 -0
  44. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/ocr/providers/__init__.py +0 -0
  45. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/ocr/providers/paddle.py +0 -0
  46. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/ocr/providers/tesseract.py +0 -0
  47. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/okf_entity_profiles.py +0 -0
  48. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/optimization/__init__.py +0 -0
  49. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/optimization/chunking.py +0 -0
  50. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/optimization/compressor.py +0 -0
  51. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/optimization/metadata.py +0 -0
  52. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/optimization/selector.py +0 -0
  53. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/pipeline.py +0 -0
  54. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/scripts/__init__.py +0 -0
  55. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/scripts/post_install.py +0 -0
  56. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/__init__.py +0 -0
  57. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/assembler.py +0 -0
  58. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/citations.py +0 -0
  59. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/entities.py +0 -0
  60. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/graph.py +0 -0
  61. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/relationships.py +0 -0
  62. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/topics.py +0 -0
  63. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/semantic/verifier.py +0 -0
  64. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/structure/__init__.py +0 -0
  65. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/structure/builder.py +0 -0
  66. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/structure/exporters.py +0 -0
  67. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/structure/recovery.py +0 -0
  68. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/structure/relationships.py +0 -0
  69. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/token_budget.py +0 -0
  70. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/tokenizer.py +0 -0
  71. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/validation/__init__.py +0 -0
  72. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/validation/layout.py +0 -0
  73. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/validation/scorer.py +0 -0
  74. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/validation/table.py +0 -0
  75. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/validation/text.py +0 -0
  76. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/pystreampdf/validation/types.py +0 -0
  77. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/src/lib.rs +0 -0
  78. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/streampdf/cli.py +0 -0
  79. {pystreampdf-2.2.0 → pystreampdf-2.3.0}/python/streampdf/server.py +0 -0
@@ -16,9 +16,9 @@ dependencies = [
16
16
 
17
17
  [[package]]
18
18
  name = "android_system_properties"
19
- version = "0.1.6"
19
+ version = "0.1.5"
20
20
  source = "registry+https://github.com/rust-lang/crates.io-index"
21
- checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"
21
+ checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
22
22
  dependencies = [
23
23
  "libc",
24
24
  ]
@@ -31,9 +31,9 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
31
31
 
32
32
  [[package]]
33
33
  name = "bitflags"
34
- version = "2.13.1"
34
+ version = "2.13.0"
35
35
  source = "registry+https://github.com/rust-lang/crates.io-index"
36
- checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
36
+ checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
37
37
 
38
38
  [[package]]
39
39
  name = "block-buffer"
@@ -52,9 +52,9 @@ checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
52
52
 
53
53
  [[package]]
54
54
  name = "bytemuck"
55
- version = "1.25.2"
55
+ version = "1.25.1"
56
56
  source = "registry+https://github.com/rust-lang/crates.io-index"
57
- checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
57
+ checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424"
58
58
 
59
59
  [[package]]
60
60
  name = "byteorder"
@@ -76,9 +76,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
76
76
 
77
77
  [[package]]
78
78
  name = "cc"
79
- version = "1.4.2"
79
+ version = "1.2.67"
80
80
  source = "registry+https://github.com/rust-lang/crates.io-index"
81
- checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e"
81
+ checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
82
82
  dependencies = [
83
83
  "find-msvc-tools",
84
84
  "shlex",
@@ -160,9 +160,9 @@ dependencies = [
160
160
 
161
161
  [[package]]
162
162
  name = "either"
163
- version = "1.17.0"
163
+ version = "1.16.0"
164
164
  source = "registry+https://github.com/rust-lang/crates.io-index"
165
- checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d"
165
+ checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
166
166
 
167
167
  [[package]]
168
168
  name = "errno"
@@ -188,27 +188,27 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
188
188
 
189
189
  [[package]]
190
190
  name = "find-msvc-tools"
191
- version = "0.1.10"
191
+ version = "0.1.9"
192
192
  source = "registry+https://github.com/rust-lang/crates.io-index"
193
- checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de"
193
+ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
194
194
 
195
195
  [[package]]
196
196
  name = "futures-core"
197
- version = "0.3.34"
197
+ version = "0.3.32"
198
198
  source = "registry+https://github.com/rust-lang/crates.io-index"
199
- checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
199
+ checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
200
200
 
201
201
  [[package]]
202
202
  name = "futures-task"
203
- version = "0.3.34"
203
+ version = "0.3.32"
204
204
  source = "registry+https://github.com/rust-lang/crates.io-index"
205
- checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
205
+ checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
206
206
 
207
207
  [[package]]
208
208
  name = "futures-util"
209
- version = "0.3.34"
209
+ version = "0.3.32"
210
210
  source = "registry+https://github.com/rust-lang/crates.io-index"
211
- checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
211
+ checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
212
212
  dependencies = [
213
213
  "futures-core",
214
214
  "futures-task",
@@ -314,9 +314,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
314
314
 
315
315
  [[package]]
316
316
  name = "js-sys"
317
- version = "0.3.104"
317
+ version = "0.3.103"
318
318
  source = "registry+https://github.com/rust-lang/crates.io-index"
319
- checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a"
319
+ checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102"
320
320
  dependencies = [
321
321
  "cfg-if",
322
322
  "futures-util",
@@ -325,9 +325,9 @@ dependencies = [
325
325
 
326
326
  [[package]]
327
327
  name = "libc"
328
- version = "0.2.189"
328
+ version = "0.2.186"
329
329
  source = "registry+https://github.com/rust-lang/crates.io-index"
330
- checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
330
+ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
331
331
 
332
332
  [[package]]
333
333
  name = "libloading"
@@ -491,15 +491,15 @@ checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
491
491
 
492
492
  [[package]]
493
493
  name = "portable-atomic"
494
- version = "1.15.0"
494
+ version = "1.13.1"
495
495
  source = "registry+https://github.com/rust-lang/crates.io-index"
496
- checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
496
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
497
497
 
498
498
  [[package]]
499
499
  name = "proc-macro2"
500
- version = "1.0.107"
500
+ version = "1.0.106"
501
501
  source = "registry+https://github.com/rust-lang/crates.io-index"
502
- checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
502
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
503
503
  dependencies = [
504
504
  "unicode-ident",
505
505
  ]
@@ -557,7 +557,7 @@ dependencies = [
557
557
  "proc-macro2",
558
558
  "pyo3-macros-backend",
559
559
  "quote",
560
- "syn 2.0.119",
560
+ "syn",
561
561
  ]
562
562
 
563
563
  [[package]]
@@ -570,12 +570,12 @@ dependencies = [
570
570
  "proc-macro2",
571
571
  "pyo3-build-config",
572
572
  "quote",
573
- "syn 2.0.119",
573
+ "syn",
574
574
  ]
575
575
 
576
576
  [[package]]
577
577
  name = "pystreampdf"
578
- version = "2.2.0"
578
+ version = "2.3.0"
579
579
  dependencies = [
580
580
  "chrono",
581
581
  "pyo3",
@@ -584,9 +584,9 @@ dependencies = [
584
584
 
585
585
  [[package]]
586
586
  name = "quote"
587
- version = "1.0.47"
587
+ version = "1.0.46"
588
588
  source = "registry+https://github.com/rust-lang/crates.io-index"
589
- checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
589
+ checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
590
590
  dependencies = [
591
591
  "proc-macro2",
592
592
  ]
@@ -629,9 +629,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
629
629
 
630
630
  [[package]]
631
631
  name = "serde"
632
- version = "1.0.229"
632
+ version = "1.0.228"
633
633
  source = "registry+https://github.com/rust-lang/crates.io-index"
634
- checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
634
+ checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
635
635
  dependencies = [
636
636
  "serde_core",
637
637
  "serde_derive",
@@ -639,29 +639,29 @@ dependencies = [
639
639
 
640
640
  [[package]]
641
641
  name = "serde_core"
642
- version = "1.0.229"
642
+ version = "1.0.228"
643
643
  source = "registry+https://github.com/rust-lang/crates.io-index"
644
- checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
644
+ checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
645
645
  dependencies = [
646
646
  "serde_derive",
647
647
  ]
648
648
 
649
649
  [[package]]
650
650
  name = "serde_derive"
651
- version = "1.0.229"
651
+ version = "1.0.228"
652
652
  source = "registry+https://github.com/rust-lang/crates.io-index"
653
- checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
653
+ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
654
654
  dependencies = [
655
655
  "proc-macro2",
656
656
  "quote",
657
- "syn 3.0.3",
657
+ "syn",
658
658
  ]
659
659
 
660
660
  [[package]]
661
661
  name = "serde_json"
662
- version = "1.0.151"
662
+ version = "1.0.150"
663
663
  source = "registry+https://github.com/rust-lang/crates.io-index"
664
- checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
664
+ checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
665
665
  dependencies = [
666
666
  "itoa",
667
667
  "memchr",
@@ -721,7 +721,7 @@ dependencies = [
721
721
 
722
722
  [[package]]
723
723
  name = "streampdf-core"
724
- version = "2.2.0"
724
+ version = "2.3.0"
725
725
  dependencies = [
726
726
  "chrono",
727
727
  "pdfium-render",
@@ -746,17 +746,6 @@ dependencies = [
746
746
  "unicode-ident",
747
747
  ]
748
748
 
749
- [[package]]
750
- name = "syn"
751
- version = "3.0.3"
752
- source = "registry+https://github.com/rust-lang/crates.io-index"
753
- checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
754
- dependencies = [
755
- "proc-macro2",
756
- "quote",
757
- "unicode-ident",
758
- ]
759
-
760
749
  [[package]]
761
750
  name = "target-lexicon"
762
751
  version = "0.12.16"
@@ -780,14 +769,14 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
780
769
  dependencies = [
781
770
  "proc-macro2",
782
771
  "quote",
783
- "syn 2.0.119",
772
+ "syn",
784
773
  ]
785
774
 
786
775
  [[package]]
787
776
  name = "tokio"
788
- version = "1.53.1"
777
+ version = "1.52.3"
789
778
  source = "registry+https://github.com/rust-lang/crates.io-index"
790
- checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
779
+ checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe"
791
780
  dependencies = [
792
781
  "bytes",
793
782
  "libc",
@@ -802,13 +791,13 @@ dependencies = [
802
791
 
803
792
  [[package]]
804
793
  name = "tokio-macros"
805
- version = "2.7.2"
794
+ version = "2.7.0"
806
795
  source = "registry+https://github.com/rust-lang/crates.io-index"
807
- checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
796
+ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
808
797
  dependencies = [
809
798
  "proc-macro2",
810
799
  "quote",
811
- "syn 3.0.3",
800
+ "syn",
812
801
  ]
813
802
 
814
803
  [[package]]
@@ -830,7 +819,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
830
819
  dependencies = [
831
820
  "proc-macro2",
832
821
  "quote",
833
- "syn 2.0.119",
822
+ "syn",
834
823
  ]
835
824
 
836
825
  [[package]]
@@ -898,9 +887,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
898
887
 
899
888
  [[package]]
900
889
  name = "wasm-bindgen"
901
- version = "0.2.127"
890
+ version = "0.2.126"
902
891
  source = "registry+https://github.com/rust-lang/crates.io-index"
903
- checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70"
892
+ checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4"
904
893
  dependencies = [
905
894
  "cfg-if",
906
895
  "once_cell",
@@ -911,9 +900,9 @@ dependencies = [
911
900
 
912
901
  [[package]]
913
902
  name = "wasm-bindgen-futures"
914
- version = "0.4.77"
903
+ version = "0.4.76"
915
904
  source = "registry+https://github.com/rust-lang/crates.io-index"
916
- checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950"
905
+ checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d"
917
906
  dependencies = [
918
907
  "js-sys",
919
908
  "wasm-bindgen",
@@ -921,9 +910,9 @@ dependencies = [
921
910
 
922
911
  [[package]]
923
912
  name = "wasm-bindgen-macro"
924
- version = "0.2.127"
913
+ version = "0.2.126"
925
914
  source = "registry+https://github.com/rust-lang/crates.io-index"
926
- checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1"
915
+ checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1"
927
916
  dependencies = [
928
917
  "quote",
929
918
  "wasm-bindgen-macro-support",
@@ -931,31 +920,31 @@ dependencies = [
931
920
 
932
921
  [[package]]
933
922
  name = "wasm-bindgen-macro-support"
934
- version = "0.2.127"
923
+ version = "0.2.126"
935
924
  source = "registry+https://github.com/rust-lang/crates.io-index"
936
- checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284"
925
+ checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e"
937
926
  dependencies = [
938
927
  "bumpalo",
939
928
  "proc-macro2",
940
929
  "quote",
941
- "syn 2.0.119",
930
+ "syn",
942
931
  "wasm-bindgen-shared",
943
932
  ]
944
933
 
945
934
  [[package]]
946
935
  name = "wasm-bindgen-shared"
947
- version = "0.2.127"
936
+ version = "0.2.126"
948
937
  source = "registry+https://github.com/rust-lang/crates.io-index"
949
- checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf"
938
+ checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24"
950
939
  dependencies = [
951
940
  "unicode-ident",
952
941
  ]
953
942
 
954
943
  [[package]]
955
944
  name = "web-sys"
956
- version = "0.3.104"
945
+ version = "0.3.103"
957
946
  source = "registry+https://github.com/rust-lang/crates.io-index"
958
- checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30"
947
+ checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141"
959
948
  dependencies = [
960
949
  "js-sys",
961
950
  "wasm-bindgen",
@@ -982,7 +971,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
982
971
  dependencies = [
983
972
  "proc-macro2",
984
973
  "quote",
985
- "syn 2.0.119",
974
+ "syn",
986
975
  ]
987
976
 
988
977
  [[package]]
@@ -993,7 +982,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
993
982
  dependencies = [
994
983
  "proc-macro2",
995
984
  "quote",
996
- "syn 2.0.119",
985
+ "syn",
997
986
  ]
998
987
 
999
988
  [[package]]
@@ -1031,22 +1020,22 @@ dependencies = [
1031
1020
 
1032
1021
  [[package]]
1033
1022
  name = "zerocopy"
1034
- version = "0.8.56"
1023
+ version = "0.8.54"
1035
1024
  source = "registry+https://github.com/rust-lang/crates.io-index"
1036
- checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb"
1025
+ checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19"
1037
1026
  dependencies = [
1038
1027
  "zerocopy-derive",
1039
1028
  ]
1040
1029
 
1041
1030
  [[package]]
1042
1031
  name = "zerocopy-derive"
1043
- version = "0.8.56"
1032
+ version = "0.8.54"
1044
1033
  source = "registry+https://github.com/rust-lang/crates.io-index"
1045
- checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1"
1034
+ checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5"
1046
1035
  dependencies = [
1047
1036
  "proc-macro2",
1048
1037
  "quote",
1049
- "syn 2.0.119",
1038
+ "syn",
1050
1039
  ]
1051
1040
 
1052
1041
  [[package]]
@@ -1057,9 +1046,9 @@ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
1057
1046
 
1058
1047
  [[package]]
1059
1048
  name = "zune-core"
1060
- version = "0.5.3"
1049
+ version = "0.5.1"
1061
1050
  source = "registry+https://github.com/rust-lang/crates.io-index"
1062
- checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
1051
+ checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9"
1063
1052
 
1064
1053
  [[package]]
1065
1054
  name = "zune-jpeg"
@@ -3,7 +3,7 @@ members = ["core", "python"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "2.2.0"
6
+ version = "2.3.0"
7
7
  edition = "2021"
8
8
  authors = ["Georgi Mammen Mullassery <mullassery@gmail.com>"]
9
9
  license = "Proprietary"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyStreamPDF
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Intended Audience :: Science/Research
@@ -35,13 +35,16 @@ Project-URL: Repository, https://github.com/Mullassery/StreamPDF
35
35
 
36
36
  # PyStreamPDF
37
37
 
38
- **Reduce RAG costs 50-70%. Extract only what matters from PDFs.**
38
+ **Extract only what matters from PDFs, so you send less to LLMs.**
39
39
 
40
- Stop sending entire documents to LLMs. PyStreamPDF analyzes structure, identifies relevant sections, and extracts only critical content. Cut token costs 50-70% while improving retrieval accuracy.
40
+ Stop sending entire documents to LLMs. PyStreamPDF parses PDF structure and
41
+ splits content into semantic, token-budget-aware chunks so you can send
42
+ only the relevant parts of a document to a model. See "Token Savings"
43
+ below for how much that saves in practice — it depends on your documents.
41
44
 
42
45
  [![PyPI](https://img.shields.io/pypi/v/pystreampdf)](https://pypi.org/project/pystreampdf)
43
46
  [![Python 3.9+](https://img.shields.io/badge/Python-3.9%2B-blue)](https://www.python.org)
44
- [![Tests: 536 Passing](https://img.shields.io/badge/tests-536%20passing-success)](./tests)
47
+ [![Tests: 557 Passing](https://img.shields.io/badge/tests-557%20passing-success)](./tests)
45
48
  [![License: Proprietary](https://img.shields.io/badge/License-Proprietary-blue.svg)](./LICENSE)
46
49
 
47
50
  ---
@@ -49,21 +52,24 @@ Stop sending entire documents to LLMs. PyStreamPDF analyzes structure, identifie
49
52
  ## 30-Second Start
50
53
 
51
54
  ```python
52
- from pystreampdf import Document
55
+ from pystreampdf import SemanticChunker, ElementType
53
56
 
54
- # Extract only relevant content from PDF
55
- doc = Document("financial_report.pdf")
57
+ with open("financial_report.pdf", "rb") as f:
58
+ text = f.read().decode("latin-1", errors="ignore") # or use a real PDF text extractor first
56
59
 
57
- # Smart content extraction
58
- relevant = doc.extract_relevant("revenue for Q3 2024")
59
- print(f"Extracted {len(relevant)} chunks")
60
- print(f"Token savings: {relevant.token_savings:.0%}") # 60% savings
61
-
62
- # Send only relevant parts to LLM
63
- for chunk in relevant:
64
- response = llm.query(chunk, "What was Q3 revenue?")
60
+ chunker = SemanticChunker(target_tokens=500)
61
+ chunks = chunker.chunk_content(
62
+ text, element_type=ElementType.TEXT, page_start=1, page_end=1
63
+ )
64
+ print(f"Split into {len(chunks)} semantic chunks")
65
65
  ```
66
66
 
67
+ There is no `Document`/`.extract_relevant()` class in this package —
68
+ `SemanticChunker` (shown above) and `PDFCache` (see "Quick Start: Document
69
+ Extraction" below) are the real, exported API. If you built against a
70
+ `Document` class from an earlier version of these docs, it never actually
71
+ existed in source; see Known Issues.
72
+
67
73
  ---
68
74
 
69
75
  ## Why PyStreamPDF?
@@ -75,10 +81,10 @@ for chunk in relevant:
75
81
  - No way to know which parts actually matter
76
82
 
77
83
  **The Solution:**
78
- - Intelligent document analysis finds relevant sections
79
- - Semantic chunking with context awareness
80
- - 50-70% reduction in token usage
81
- - Better retrieval accuracy (less noise)
84
+ - Semantic chunking with context awareness (real, in `SemanticChunker`)
85
+ - Token-budget-aware caching (real, in `PDFCache` / `TokenBudgetConfig`)
86
+ - Reduces the volume of text you send per query — see "Token Savings"
87
+ below for what's measured vs. illustrative
82
88
 
83
89
  ---
84
90
 
@@ -92,52 +98,24 @@ for chunk in relevant:
92
98
  - **Token Budgeting:** Allocate tokens by document type
93
99
  - **Smart Caching:** L1 memory + L2 disk (HMAC-signed on disk — no unverified deserialization)
94
100
  - **Metadata Preservation:** Keep tables, images, structure
95
- - **Production-Ready:** 536 passing tests (2 skipped when optional OCR system deps aren't installed)
101
+ - **Production-Ready:** 557 passing tests (2 skipped when optional OCR system deps aren't installed)
96
102
 
97
103
  ---
98
104
 
99
105
  ## Real-World Use Cases
100
106
 
101
- **Financial Documents:**
102
- ```python
103
- # Extract relevant sections from annual report
104
- doc = Document("10-K_2024.pdf")
105
- revenue_sections = doc.extract_relevant("revenue")
106
- earnings_sections = doc.extract_relevant("earnings")
107
-
108
- # 70% fewer tokens than sending whole PDF
109
- for section in revenue_sections:
110
- summary = llm.query(section, "What was total revenue?")
111
- ```
112
-
113
- **Legal Contracts:**
114
- ```python
115
- # Find clauses without reading everything
116
- doc = Document("contract.pdf")
117
- liability = doc.extract_relevant("liability", "indemnification")
118
- print(f"Found in {len(liability)} sections")
119
- ```
120
-
121
- **Research Papers:**
122
- ```python
123
- # Extract methodology and results
124
- doc = Document("paper.pdf")
125
- methods = doc.extract_relevant("methods", "experiment")
126
- results = doc.extract_relevant("results", "findings")
127
- ```
107
+ See [examples/basic_parse.py](examples/basic_parse.py) for the Rust-backed
108
+ `pystreampdf.open()` path (document/page/structure inspection — requires
109
+ the compiled `_core` extension, see Known Issues) and
110
+ [examples/token_budget_and_cache_example.py](examples/token_budget_and_cache_example.py)
111
+ for the pure-Python `SemanticChunker` + `PDFCache` + `TokenBudgetConfig`
112
+ path shown above. Both are real, runnable scripts — copying them is more
113
+ reliable than a README snippet for an evolving API.
128
114
 
129
115
  ---
130
116
 
131
117
  ## Token Savings
132
118
 
133
- | Document | Size | Full PDF Tokens | PyStreamPDF | Savings |
134
- |----------|------|-----------------|-------------|---------|
135
- | Annual Report | 200 pages | 50K | 15K | 70% |
136
- | Contract | 50 pages | 12K | 4K | 67% |
137
- | Research Paper | 30 pages | 8K | 2K | 75% |
138
-
139
- **Results:** Lower costs + better retrieval accuracy + faster responses
140
-
141
119
  **A note on how token counts are computed:** by default, token counts use a
142
120
  `len(text) / 4` heuristic (a common rule of thumb, but approximate — it can
143
121
  be off by a meaningful margin, especially for code or non-English text).
@@ -150,9 +128,15 @@ pip install "pystreampdf[tiktoken]"
150
128
  When `tiktoken` is installed, `pystreampdf.tokenizer.is_exact()` returns
151
129
  `True` and counts use the real `cl100k_base` encoding; otherwise it falls
152
130
  back to the heuristic. Check `pystreampdf.tokenizer.TOKENIZER_MODE` to see
153
- which mode produced a given number. The savings figures in the table above
154
- were measured using the heuristic mode; your exact numbers with `tiktoken`
155
- enabled may differ slightly.
131
+ which mode produced a given number.
132
+
133
+ Actual token savings depend entirely on your documents and how narrowly
134
+ you scope `extract_relevant`-style queries — there's no committed
135
+ benchmark result in this repo backing a specific percentage (the earlier
136
+ "70%"/"10-50x" style claims in this README and in `__init__.py`'s
137
+ docstring weren't measured against anything checked in). Run
138
+ [examples/token_budget_and_cache_example.py](examples/token_budget_and_cache_example.py)
139
+ against your own documents to get a real number for your use case.
156
140
 
157
141
  ---
158
142
 
@@ -242,11 +226,46 @@ structure detection, metadata, chunking, citations, validation). It's
242
226
  opt-in, binds to `127.0.0.1` only, and requires `allow_remote=True` to be
243
227
  exposed beyond localhost. See [examples/mcp_pystreampdf.py](examples/mcp_pystreampdf.py).
244
228
 
229
+ ## Known Issues
230
+
231
+ - Earlier versions of this README documented a `Document` class with
232
+ `.extract_relevant()` and a `.token_savings` attribute — verified
233
+ against source: this class has never existed in this package. Fixed
234
+ in this pass to describe the real, exported API (`SemanticChunker`,
235
+ `PDFCache`, `TokenBudgetConfig`, and the Rust-backed `pystreampdf.open()`).
236
+ - The published PyPI wheel is the only wheel on PyPI — macOS arm64 only,
237
+ no sdist. On any other platform or Python version, `pip install` will
238
+ fail without a local Rust toolchain to build from source.
239
+ - ~~The published version (2.2.1) is ahead of what's tagged in this repo's
240
+ Cargo.toml/__init__.py (2.2.0)~~ Resolved: 2.3.0 (this release) is
241
+ unambiguously ahead of both 2.2.0 and 2.2.1.
242
+ - The Rust-backed `pystreampdf.open()` / `pystreampdf.load_index()` API
243
+ (used in `examples/basic_parse.py`) silently becomes `None` if the
244
+ compiled `_core` extension isn't available (e.g. a from-source install
245
+ without `maturin develop`) — falling back to `SemanticChunker`/`PDFCache`
246
+ in that case, per the code above, not a hard error.
247
+ - The "Tests & Build" GitHub Actions workflow was red for several weeks
248
+ due to two CI infrastructure bugs (not the test suite itself), both
249
+ now fixed and confirmed green in CI:
250
+ [run 32611116541](https://github.com/Mullassery/PyStreamPDF/actions/runs/32611116541).
251
+ First, `dtolnay/rust-toolchain@v1` required an explicit `toolchain`
252
+ input the workflow didn't provide, failing both jobs before any tests
253
+ ran — fixed by pinning to `dtolnay/rust-toolchain@stable`. Second, once
254
+ that was fixed, `maturin develop` failed in the Python-test job because
255
+ `actions/setup-python` doesn't provide an active virtualenv, which
256
+ maturin requires — fixed by creating and activating a `.venv` before
257
+ the build step. Actual CI output as of 2.2.0: `pytest` — 536 passed, 2
258
+ skipped (Python 3.10, 3.11, and 3.12, each identical); `cargo test` — 23
259
+ passed, 0 failed. (The Rust suite has 23 tests, not 536 — an earlier
260
+ version of this section conflated the pytest count with the Rust one.)
261
+ As of 2.3.0: `pytest` — 557 passed, 2 skipped (21 new tests added for
262
+ `tests/test_mcp_tools.py`).
263
+
245
264
  ## License
246
265
 
247
266
  Proprietary License — Free to use with explicit attribution. See [LICENSE](LICENSE).
248
267
 
249
268
  ---
250
269
 
251
- **PyStreamPDF v2.2.0** | Intelligent PDF processing for AI | Python 3.9+ | 536 passing tests
270
+ **PyStreamPDF v2.3.0** | Intelligent PDF processing for AI | Python 3.9+ | 557 passing tests
252
271