PyStreamPDF 2.1.2__tar.gz → 2.2.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 (81) hide show
  1. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/Cargo.lock +81 -70
  2. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/Cargo.toml +1 -1
  3. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/PKG-INFO +65 -56
  4. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/README.md +55 -55
  5. pystreampdf-2.2.0/core/src/pdf_parser.rs +183 -0
  6. pystreampdf-2.2.0/core/src/security.rs +205 -0
  7. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/pyproject.toml +13 -1
  8. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/__init__.py +1 -1
  9. pystreampdf-2.2.0/python/pystreampdf/_mcp_connector.py +179 -0
  10. pystreampdf-2.2.0/python/pystreampdf/_mcp_tools.py +271 -0
  11. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/cache.py +82 -9
  12. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/cli_daemon.py +14 -6
  13. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/extraction.py +7 -3
  14. pystreampdf-2.2.0/python/pystreampdf/okf_entity_profiles.py +82 -0
  15. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/optimization/metadata.py +3 -1
  16. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/optimization/selector.py +7 -2
  17. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/assembler.py +14 -8
  18. pystreampdf-2.2.0/python/pystreampdf/tokenizer.py +68 -0
  19. pystreampdf-2.1.2/core/src/pdf_parser.rs +0 -179
  20. pystreampdf-2.1.2/core/src/security.rs +0 -126
  21. pystreampdf-2.1.2/python/pystreampdf/intelligence/__init__.py.bak +0 -28
  22. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/LICENSE +0 -0
  23. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/Cargo.toml +0 -0
  24. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/audit.rs +0 -0
  25. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/context.rs +0 -0
  26. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/document.rs +0 -0
  27. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/error.rs +0 -0
  28. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/forms.rs +0 -0
  29. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/heading_extractor.rs +0 -0
  30. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/index.rs +0 -0
  31. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/lib.rs +0 -0
  32. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/markdown.rs +0 -0
  33. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/navigator.rs +0 -0
  34. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/page.rs +0 -0
  35. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/core/src/structure.rs +0 -0
  36. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/Cargo.toml +0 -0
  37. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/cli.py +0 -0
  38. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/cli_dashboard.py +0 -0
  39. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/excel_export.py +0 -0
  40. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/intelligence/__init__.py +0 -0
  41. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/intelligence/code_intelligence.py +0 -0
  42. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/intelligence/json_intelligence.py +0 -0
  43. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/intelligence/log_intelligence.py +0 -0
  44. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/intelligence/sql_intelligence.py +0 -0
  45. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/intelligence/types.py +0 -0
  46. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/intelligence/yaml_intelligence.py +0 -0
  47. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/ocr/__init__.py +0 -0
  48. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/ocr/manager.py +0 -0
  49. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/ocr/pipeline.py +0 -0
  50. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/ocr/provider.py +0 -0
  51. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/ocr/providers/__init__.py +0 -0
  52. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/ocr/providers/paddle.py +0 -0
  53. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/ocr/providers/tesseract.py +0 -0
  54. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/optimization/__init__.py +0 -0
  55. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/optimization/chunking.py +0 -0
  56. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/optimization/compressor.py +0 -0
  57. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/pipeline.py +0 -0
  58. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/scripts/__init__.py +0 -0
  59. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/scripts/post_install.py +0 -0
  60. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/__init__.py +0 -0
  61. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/citations.py +0 -0
  62. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/entities.py +0 -0
  63. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/graph.py +0 -0
  64. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/relationships.py +0 -0
  65. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/topics.py +0 -0
  66. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/semantic/verifier.py +0 -0
  67. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/structure/__init__.py +0 -0
  68. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/structure/builder.py +0 -0
  69. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/structure/exporters.py +0 -0
  70. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/structure/recovery.py +0 -0
  71. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/structure/relationships.py +0 -0
  72. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/token_budget.py +0 -0
  73. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/validation/__init__.py +0 -0
  74. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/validation/layout.py +0 -0
  75. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/validation/scorer.py +0 -0
  76. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/validation/table.py +0 -0
  77. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/validation/text.py +0 -0
  78. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/pystreampdf/validation/types.py +0 -0
  79. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/src/lib.rs +0 -0
  80. {pystreampdf-2.1.2 → pystreampdf-2.2.0}/python/streampdf/cli.py +0 -0
  81. {pystreampdf-2.1.2 → pystreampdf-2.2.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.5"
19
+ version = "0.1.6"
20
20
  source = "registry+https://github.com/rust-lang/crates.io-index"
21
- checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
21
+ checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"
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.0"
34
+ version = "2.13.1"
35
35
  source = "registry+https://github.com/rust-lang/crates.io-index"
36
- checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
36
+ checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
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.1"
55
+ version = "1.25.2"
56
56
  source = "registry+https://github.com/rust-lang/crates.io-index"
57
- checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424"
57
+ checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
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.2.67"
79
+ version = "1.4.2"
80
80
  source = "registry+https://github.com/rust-lang/crates.io-index"
81
- checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
81
+ checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e"
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.16.0"
163
+ version = "1.17.0"
164
164
  source = "registry+https://github.com/rust-lang/crates.io-index"
165
- checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
165
+ checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d"
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.9"
191
+ version = "0.1.10"
192
192
  source = "registry+https://github.com/rust-lang/crates.io-index"
193
- checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
193
+ checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de"
194
194
 
195
195
  [[package]]
196
196
  name = "futures-core"
197
- version = "0.3.32"
197
+ version = "0.3.34"
198
198
  source = "registry+https://github.com/rust-lang/crates.io-index"
199
- checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
199
+ checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
200
200
 
201
201
  [[package]]
202
202
  name = "futures-task"
203
- version = "0.3.32"
203
+ version = "0.3.34"
204
204
  source = "registry+https://github.com/rust-lang/crates.io-index"
205
- checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
205
+ checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
206
206
 
207
207
  [[package]]
208
208
  name = "futures-util"
209
- version = "0.3.32"
209
+ version = "0.3.34"
210
210
  source = "registry+https://github.com/rust-lang/crates.io-index"
211
- checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
211
+ checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
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.103"
317
+ version = "0.3.104"
318
318
  source = "registry+https://github.com/rust-lang/crates.io-index"
319
- checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102"
319
+ checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a"
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.186"
328
+ version = "0.2.189"
329
329
  source = "registry+https://github.com/rust-lang/crates.io-index"
330
- checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
330
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
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.13.1"
494
+ version = "1.15.0"
495
495
  source = "registry+https://github.com/rust-lang/crates.io-index"
496
- checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
496
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
497
497
 
498
498
  [[package]]
499
499
  name = "proc-macro2"
500
- version = "1.0.106"
500
+ version = "1.0.107"
501
501
  source = "registry+https://github.com/rust-lang/crates.io-index"
502
- checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
502
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
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",
560
+ "syn 2.0.119",
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",
573
+ "syn 2.0.119",
574
574
  ]
575
575
 
576
576
  [[package]]
577
577
  name = "pystreampdf"
578
- version = "2.1.2"
578
+ version = "2.2.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.46"
587
+ version = "1.0.47"
588
588
  source = "registry+https://github.com/rust-lang/crates.io-index"
589
- checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
589
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
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.228"
632
+ version = "1.0.229"
633
633
  source = "registry+https://github.com/rust-lang/crates.io-index"
634
- checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
634
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
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.228"
642
+ version = "1.0.229"
643
643
  source = "registry+https://github.com/rust-lang/crates.io-index"
644
- checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
644
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
645
645
  dependencies = [
646
646
  "serde_derive",
647
647
  ]
648
648
 
649
649
  [[package]]
650
650
  name = "serde_derive"
651
- version = "1.0.228"
651
+ version = "1.0.229"
652
652
  source = "registry+https://github.com/rust-lang/crates.io-index"
653
- checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
653
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
654
654
  dependencies = [
655
655
  "proc-macro2",
656
656
  "quote",
657
- "syn",
657
+ "syn 3.0.3",
658
658
  ]
659
659
 
660
660
  [[package]]
661
661
  name = "serde_json"
662
- version = "1.0.150"
662
+ version = "1.0.151"
663
663
  source = "registry+https://github.com/rust-lang/crates.io-index"
664
- checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
664
+ checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
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.1.2"
724
+ version = "2.2.0"
725
725
  dependencies = [
726
726
  "chrono",
727
727
  "pdfium-render",
@@ -746,6 +746,17 @@ 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
+
749
760
  [[package]]
750
761
  name = "target-lexicon"
751
762
  version = "0.12.16"
@@ -769,14 +780,14 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
769
780
  dependencies = [
770
781
  "proc-macro2",
771
782
  "quote",
772
- "syn",
783
+ "syn 2.0.119",
773
784
  ]
774
785
 
775
786
  [[package]]
776
787
  name = "tokio"
777
- version = "1.52.3"
788
+ version = "1.53.1"
778
789
  source = "registry+https://github.com/rust-lang/crates.io-index"
779
- checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe"
790
+ checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
780
791
  dependencies = [
781
792
  "bytes",
782
793
  "libc",
@@ -791,13 +802,13 @@ dependencies = [
791
802
 
792
803
  [[package]]
793
804
  name = "tokio-macros"
794
- version = "2.7.0"
805
+ version = "2.7.2"
795
806
  source = "registry+https://github.com/rust-lang/crates.io-index"
796
- checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
807
+ checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
797
808
  dependencies = [
798
809
  "proc-macro2",
799
810
  "quote",
800
- "syn",
811
+ "syn 3.0.3",
801
812
  ]
802
813
 
803
814
  [[package]]
@@ -819,7 +830,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
819
830
  dependencies = [
820
831
  "proc-macro2",
821
832
  "quote",
822
- "syn",
833
+ "syn 2.0.119",
823
834
  ]
824
835
 
825
836
  [[package]]
@@ -887,9 +898,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
887
898
 
888
899
  [[package]]
889
900
  name = "wasm-bindgen"
890
- version = "0.2.126"
901
+ version = "0.2.127"
891
902
  source = "registry+https://github.com/rust-lang/crates.io-index"
892
- checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4"
903
+ checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70"
893
904
  dependencies = [
894
905
  "cfg-if",
895
906
  "once_cell",
@@ -900,9 +911,9 @@ dependencies = [
900
911
 
901
912
  [[package]]
902
913
  name = "wasm-bindgen-futures"
903
- version = "0.4.76"
914
+ version = "0.4.77"
904
915
  source = "registry+https://github.com/rust-lang/crates.io-index"
905
- checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d"
916
+ checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950"
906
917
  dependencies = [
907
918
  "js-sys",
908
919
  "wasm-bindgen",
@@ -910,9 +921,9 @@ dependencies = [
910
921
 
911
922
  [[package]]
912
923
  name = "wasm-bindgen-macro"
913
- version = "0.2.126"
924
+ version = "0.2.127"
914
925
  source = "registry+https://github.com/rust-lang/crates.io-index"
915
- checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1"
926
+ checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1"
916
927
  dependencies = [
917
928
  "quote",
918
929
  "wasm-bindgen-macro-support",
@@ -920,31 +931,31 @@ dependencies = [
920
931
 
921
932
  [[package]]
922
933
  name = "wasm-bindgen-macro-support"
923
- version = "0.2.126"
934
+ version = "0.2.127"
924
935
  source = "registry+https://github.com/rust-lang/crates.io-index"
925
- checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e"
936
+ checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284"
926
937
  dependencies = [
927
938
  "bumpalo",
928
939
  "proc-macro2",
929
940
  "quote",
930
- "syn",
941
+ "syn 2.0.119",
931
942
  "wasm-bindgen-shared",
932
943
  ]
933
944
 
934
945
  [[package]]
935
946
  name = "wasm-bindgen-shared"
936
- version = "0.2.126"
947
+ version = "0.2.127"
937
948
  source = "registry+https://github.com/rust-lang/crates.io-index"
938
- checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24"
949
+ checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf"
939
950
  dependencies = [
940
951
  "unicode-ident",
941
952
  ]
942
953
 
943
954
  [[package]]
944
955
  name = "web-sys"
945
- version = "0.3.103"
956
+ version = "0.3.104"
946
957
  source = "registry+https://github.com/rust-lang/crates.io-index"
947
- checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141"
958
+ checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30"
948
959
  dependencies = [
949
960
  "js-sys",
950
961
  "wasm-bindgen",
@@ -971,7 +982,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
971
982
  dependencies = [
972
983
  "proc-macro2",
973
984
  "quote",
974
- "syn",
985
+ "syn 2.0.119",
975
986
  ]
976
987
 
977
988
  [[package]]
@@ -982,7 +993,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
982
993
  dependencies = [
983
994
  "proc-macro2",
984
995
  "quote",
985
- "syn",
996
+ "syn 2.0.119",
986
997
  ]
987
998
 
988
999
  [[package]]
@@ -1020,22 +1031,22 @@ dependencies = [
1020
1031
 
1021
1032
  [[package]]
1022
1033
  name = "zerocopy"
1023
- version = "0.8.54"
1034
+ version = "0.8.56"
1024
1035
  source = "registry+https://github.com/rust-lang/crates.io-index"
1025
- checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19"
1036
+ checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb"
1026
1037
  dependencies = [
1027
1038
  "zerocopy-derive",
1028
1039
  ]
1029
1040
 
1030
1041
  [[package]]
1031
1042
  name = "zerocopy-derive"
1032
- version = "0.8.54"
1043
+ version = "0.8.56"
1033
1044
  source = "registry+https://github.com/rust-lang/crates.io-index"
1034
- checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5"
1045
+ checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1"
1035
1046
  dependencies = [
1036
1047
  "proc-macro2",
1037
1048
  "quote",
1038
- "syn",
1049
+ "syn 2.0.119",
1039
1050
  ]
1040
1051
 
1041
1052
  [[package]]
@@ -1046,9 +1057,9 @@ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
1046
1057
 
1047
1058
  [[package]]
1048
1059
  name = "zune-core"
1049
- version = "0.5.1"
1060
+ version = "0.5.3"
1050
1061
  source = "registry+https://github.com/rust-lang/crates.io-index"
1051
- checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9"
1062
+ checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
1052
1063
 
1053
1064
  [[package]]
1054
1065
  name = "zune-jpeg"
@@ -3,7 +3,7 @@ members = ["core", "python"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "2.1.2"
6
+ version = "2.2.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.1.2
3
+ Version: 2.2.0
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Intended Audience :: Science/Research
@@ -15,6 +15,15 @@ Classifier: Programming Language :: Rust
15
15
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
16
  Classifier: Topic :: Text Processing
17
17
  Requires-Dist: rich>=13.0
18
+ Requires-Dist: pyyaml>=6.0
19
+ Requires-Dist: maturin>=1.0,<2.0 ; extra == 'dev'
20
+ Requires-Dist: pytest>=7.0 ; extra == 'dev'
21
+ Requires-Dist: pytest-timeout>=2.1 ; extra == 'dev'
22
+ Requires-Dist: reportlab>=4.0 ; extra == 'dev'
23
+ Requires-Dist: tiktoken>=0.5 ; extra == 'dev'
24
+ Requires-Dist: tiktoken>=0.5 ; extra == 'tiktoken'
25
+ Provides-Extra: dev
26
+ Provides-Extra: tiktoken
18
27
  License-File: LICENSE
19
28
  Summary: Intelligence engine for PDFs: selective retrieval, structure analysis, and token-efficient RAG
20
29
  Keywords: pdf,retrieval,rag,ai,intelligence,search,indexing
@@ -31,8 +40,8 @@ Project-URL: Repository, https://github.com/Mullassery/StreamPDF
31
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.
32
41
 
33
42
  [![PyPI](https://img.shields.io/pypi/v/pystreampdf)](https://pypi.org/project/pystreampdf)
34
- [![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue)](https://www.python.org)
35
- [![Tests: 523 Passing](https://img.shields.io/badge/tests-523%20passing-success)](./tests)
43
+ [![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)
36
45
  [![License: Proprietary](https://img.shields.io/badge/License-Proprietary-blue.svg)](./LICENSE)
37
46
 
38
47
  ---
@@ -75,13 +84,15 @@ for chunk in relevant:
75
84
 
76
85
  ## Key Features
77
86
 
87
+ - **Real encryption/permission detection:** Backed by PDFium's actual document security APIs — not a stub. Encrypted, password-protected, and permission-restricted PDFs are detected and reported accurately; opening with a wrong/missing password fails closed rather than silently succeeding.
88
+ - **Honest failure signaling:** If a PDF can't be parsed (corrupt, truncated, unsupported), you get a real error — never fabricated placeholder content.
78
89
  - **Intelligent Extraction:** Find relevant sections automatically
79
90
  - **Semantic Chunking:** Context-aware splitting, not just word count
80
91
  - **Multi-Format:** Text, tables, images, charts, OCR
81
92
  - **Token Budgeting:** Allocate tokens by document type
82
- - **Smart Caching:** L1 memory + L2 disk (avoid reprocessing)
93
+ - **Smart Caching:** L1 memory + L2 disk (HMAC-signed on disk — no unverified deserialization)
83
94
  - **Metadata Preservation:** Keep tables, images, structure
84
- - **Production-Ready:** 523 tests, type-safe API
95
+ - **Production-Ready:** 536 passing tests (2 skipped when optional OCR system deps aren't installed)
85
96
 
86
97
  ---
87
98
 
@@ -127,14 +138,48 @@ results = doc.extract_relevant("results", "findings")
127
138
 
128
139
  **Results:** Lower costs + better retrieval accuracy + faster responses
129
140
 
141
+ **A note on how token counts are computed:** by default, token counts use a
142
+ `len(text) / 4` heuristic (a common rule of thumb, but approximate — it can
143
+ be off by a meaningful margin, especially for code or non-English text).
144
+ Install the optional `tiktoken` extra for exact BPE token counts:
145
+
146
+ ```bash
147
+ pip install "pystreampdf[tiktoken]"
148
+ ```
149
+
150
+ When `tiktoken` is installed, `pystreampdf.tokenizer.is_exact()` returns
151
+ `True` and counts use the real `cl100k_base` encoding; otherwise it falls
152
+ 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.
156
+
157
+ ---
158
+
159
+ ## Security Notes
160
+
161
+ - **Encryption & permissions**: `pystreampdf._core.PyPdfDocument.is_encrypted()`,
162
+ `.permissions()`, and `.open_with_password()` are backed by PDFium's real
163
+ document security APIs. A wrong or missing password on an encrypted PDF
164
+ raises an error — it never falls back to an unauthenticated parse.
165
+ - **Cache integrity**: the on-disk (L2) cache is HMAC-SHA256 signed using a
166
+ key generated on first use and stored with owner-only (0600) permissions.
167
+ A tampered or foreign cache file fails signature verification and is
168
+ discarded before any deserialization occurs.
169
+ - **MCP/DAB connector**: binds to `127.0.0.1` with no cross-origin access
170
+ and read-only permissions by default. Wider exposure requires an explicit
171
+ `allow_remote=True` opt-in — review the security implications first, since
172
+ the connector has no authentication of its own.
173
+
130
174
  ---
131
175
 
132
176
  ## Installation
133
177
 
134
178
  ```bash
135
179
  pip install pystreampdf
136
- # or with uv
137
- uv pip install pystreampdf
180
+
181
+ # With exact token counting (tiktoken)
182
+ pip install "pystreampdf[tiktoken]"
138
183
  ```
139
184
 
140
185
  ---
@@ -144,25 +189,13 @@ uv pip install pystreampdf
144
189
  - [Quick Start](docs/QUICKSTART.md) — Process your first PDF
145
190
  - [Extraction Strategies](docs/EXTRACTION.md) — Different approaches for different documents
146
191
  - [Token Budgeting](docs/TOKEN_BUDGETS.md) — Control context allocation
192
+ - [Token Budget Multipliers](docs/TOKEN_BUDGET_MULTIPLIERS.md) — Comprehensive token budget guide with examples
147
193
  - [Examples](examples/) — Real-world RAG optimization
148
194
 
149
- ---
150
-
151
- ## License
152
-
153
- Proprietary License - Free to use with explicit attribution. See [LICENSE](LICENSE).
154
-
155
- ---
156
-
157
- **PyStreamPDF v2.1.0** | Intelligent PDF processing for AI | Python 3.10+ | 523 tests
158
- ```
159
-
160
- See [TOKEN_BUDGET_MULTIPLIERS.md](docs/TOKEN_BUDGET_MULTIPLIERS.md) for comprehensive guide.
161
-
162
195
  ## Quick Start: Document Extraction
163
196
 
164
197
  ```python
165
- from pystreampdf import SemanticChunker, PDFCache, TokenBudgetConfig
198
+ from pystreampdf import SemanticChunker, PDFCache, TokenBudgetConfig, BudgetRule
166
199
 
167
200
  # Setup budget config
168
201
  budget_config = TokenBudgetConfig(
@@ -181,63 +214,39 @@ cache = PDFCache(
181
214
  def extract_pdf(pdf_path):
182
215
  chunks, preview, title, pages = cache.get_or_process(
183
216
  pdf_path,
184
- processor_fn=extract_chunks
217
+ process_fn=extract_chunks
185
218
  )
186
219
  return chunks
187
220
 
188
221
  # Use semantic chunker directly
189
222
  chunker = SemanticChunker(target_tokens=500)
190
- chunks = chunker.chunk_content(text, element_type=ElementType.TEXT)
223
+ chunks = chunker.chunk_content(text, element_type=ElementType.TEXT, page_start=1, page_end=1)
191
224
  ```
192
225
 
193
226
  ## Budget Configuration
194
227
 
195
228
  ### Default Settings
196
229
  - **Minimum budget**: 500 tokens (fixed)
197
- - **Maximum budget**: 1000 tokens (fixed)
230
+ - **Maximum budget**: 1000 tokens (fixed)
198
231
  - **Default base**: 1000 tokens
199
232
  - **Multiplier range**: 0.5 - 1.5 (common)
200
233
 
201
234
  ### Dynamic Adjustment via Multipliers
202
235
  Use keyword-based rules to scale within the 500-1000 range without changing hard limits. See examples for [financial](docs/TOKEN_BUDGET_MULTIPLIERS.md#high-complexity-documents), [legal](docs/TOKEN_BUDGET_MULTIPLIERS.md#high-complexity-documents), and [summary](docs/TOKEN_BUDGET_MULTIPLIERS.md#low-complexity-documents) documents.
203
236
 
204
- ## MCP 2.0 Integration
205
-
206
- Enable MCP tools on port **8780** (see MCP_QUICKSTART.md for details).
207
-
208
- AI systems discover all 207 tools across 18 projects:
209
- - 12 PyStreamPDF tools for document processing
210
- - 195 tools from 17 integrated projects
211
- - Multi-project workflows with intelligent orchestration
212
- - 60-75% reduction in context usage through query optimization
213
-
214
- ## Documentation
215
-
216
- - **[TOKEN_BUDGET_MULTIPLIERS.md](docs/TOKEN_BUDGET_MULTIPLIERS.md)** - Comprehensive token budget guide with examples
217
- - **[ARCHITECTURE.md](docs/ARCHITECTURE.md)** - System design and components
218
- - **[PRODUCT_VISION.md](docs/PRODUCT_VISION.md)** - Long-term strategy and roadmap
219
- - **[ROADMAP.md](docs/ROADMAP.md)** - Planned features and enhancements
220
-
221
- ## Part of Unified Platform
222
-
223
- 18 projects, 207 tools, 18 simultaneous MCP endpoints (8765-8782).
224
-
225
- **All tools discoverable via MCP protocol in a single connection.**
226
-
227
- ## Version History
237
+ ## MCP Integration (optional, local by default)
228
238
 
229
- ### v2.0.0 (Current)
230
- - ✅ MCP 2.0 Support
231
- - ✅ Integrated with 17 other projects
232
- - ✅ 207 unified MCP tools
233
- - ✅ Intelligent orchestration
234
- - ✅ Production-ready (wheels only)
239
+ PyStreamPDF ships an optional MCP/DAB connector (`pystreampdf._mcp_connector`)
240
+ exposing document-processing tools (extract text/tables/images, OCR,
241
+ structure detection, metadata, chunking, citations, validation). It's
242
+ opt-in, binds to `127.0.0.1` only, and requires `allow_remote=True` to be
243
+ exposed beyond localhost. See [examples/mcp_pystreampdf.py](examples/mcp_pystreampdf.py).
235
244
 
236
245
  ## License
237
246
 
238
- MIT
247
+ Proprietary License — Free to use with explicit attribution. See [LICENSE](LICENSE).
239
248
 
240
249
  ---
241
250
 
242
- **MCP 2.0 Mega-Platform | v2.0.0 | Wheels-Only Distribution**
251
+ **PyStreamPDF v2.2.0** | Intelligent PDF processing for AI | Python 3.9+ | 536 passing tests
243
252