PyStreamPDF 2.3.1__tar.gz → 2.3.2__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 (78) hide show
  1. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/Cargo.lock +2 -2
  2. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/Cargo.toml +1 -1
  3. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/PKG-INFO +1 -1
  4. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/__init__.py +1 -1
  5. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/citations.py +20 -0
  6. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/streampdf/server.py +4 -4
  7. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/LICENSE +0 -0
  8. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/README.md +0 -0
  9. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/Cargo.toml +0 -0
  10. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/audit.rs +0 -0
  11. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/context.rs +0 -0
  12. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/document.rs +0 -0
  13. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/error.rs +0 -0
  14. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/forms.rs +0 -0
  15. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/heading_extractor.rs +0 -0
  16. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/index.rs +0 -0
  17. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/lib.rs +0 -0
  18. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/markdown.rs +0 -0
  19. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/navigator.rs +0 -0
  20. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/page.rs +0 -0
  21. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/pdf_parser.rs +0 -0
  22. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/security.rs +0 -0
  23. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/core/src/structure.rs +0 -0
  24. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/pyproject.toml +0 -0
  25. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/Cargo.toml +0 -0
  26. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/_mcp_connector.py +0 -0
  27. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/_mcp_tools.py +0 -0
  28. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/cache.py +0 -0
  29. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/cli.py +0 -0
  30. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/cli_daemon.py +0 -0
  31. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/cli_dashboard.py +0 -0
  32. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/excel_export.py +0 -0
  33. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/extraction.py +0 -0
  34. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/intelligence/__init__.py +0 -0
  35. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/intelligence/code_intelligence.py +0 -0
  36. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/intelligence/json_intelligence.py +0 -0
  37. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/intelligence/log_intelligence.py +0 -0
  38. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/intelligence/sql_intelligence.py +0 -0
  39. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/intelligence/types.py +0 -0
  40. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/intelligence/yaml_intelligence.py +0 -0
  41. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/ocr/__init__.py +0 -0
  42. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/ocr/manager.py +0 -0
  43. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/ocr/pipeline.py +0 -0
  44. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/ocr/provider.py +0 -0
  45. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/ocr/providers/__init__.py +0 -0
  46. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/ocr/providers/paddle.py +0 -0
  47. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/ocr/providers/tesseract.py +0 -0
  48. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/okf_entity_profiles.py +0 -0
  49. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/optimization/__init__.py +0 -0
  50. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/optimization/chunking.py +0 -0
  51. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/optimization/compressor.py +0 -0
  52. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/optimization/metadata.py +0 -0
  53. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/optimization/selector.py +0 -0
  54. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/pipeline.py +0 -0
  55. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/scripts/__init__.py +0 -0
  56. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/scripts/post_install.py +0 -0
  57. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/__init__.py +0 -0
  58. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/assembler.py +0 -0
  59. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/entities.py +0 -0
  60. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/graph.py +0 -0
  61. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/relationships.py +0 -0
  62. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/topics.py +0 -0
  63. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/semantic/verifier.py +0 -0
  64. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/structure/__init__.py +0 -0
  65. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/structure/builder.py +0 -0
  66. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/structure/exporters.py +0 -0
  67. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/structure/recovery.py +0 -0
  68. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/structure/relationships.py +0 -0
  69. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/token_budget.py +0 -0
  70. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/tokenizer.py +0 -0
  71. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/validation/__init__.py +0 -0
  72. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/validation/layout.py +0 -0
  73. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/validation/scorer.py +0 -0
  74. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/validation/table.py +0 -0
  75. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/validation/text.py +0 -0
  76. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/pystreampdf/validation/types.py +0 -0
  77. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/src/lib.rs +0 -0
  78. {pystreampdf-2.3.1 → pystreampdf-2.3.2}/python/streampdf/cli.py +0 -0
@@ -551,7 +551,7 @@ dependencies = [
551
551
 
552
552
  [[package]]
553
553
  name = "pystreampdf"
554
- version = "2.3.1"
554
+ version = "2.3.2"
555
555
  dependencies = [
556
556
  "chrono",
557
557
  "pyo3",
@@ -697,7 +697,7 @@ dependencies = [
697
697
 
698
698
  [[package]]
699
699
  name = "streampdf-core"
700
- version = "2.3.1"
700
+ version = "2.3.2"
701
701
  dependencies = [
702
702
  "chrono",
703
703
  "pdfium-render",
@@ -3,7 +3,7 @@ members = ["core", "python"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "2.3.1"
6
+ version = "2.3.2"
7
7
  edition = "2021"
8
8
  authors = ["Georgi Mammen Mullassery <mullassery@gmail.com>"]
9
9
  license = "Apache-2.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyStreamPDF
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Intended Audience :: Science/Research
@@ -5,7 +5,7 @@ Actual token savings depend on your documents — see the README's "Token
5
5
  Savings" section rather than relying on a fixed multiplier here.
6
6
  """
7
7
 
8
- __version__ = "2.3.1" # Real MCP tool implementations (extract/OCR/validate/etc.), previously all hardcoded fixture data
8
+ __version__ = "2.3.2" # Real MCP tool implementations (extract/OCR/validate/etc.), previously all hardcoded fixture data
9
9
 
10
10
  # Optional: Rust core bindings (requires maturin build)
11
11
  try:
@@ -36,3 +36,23 @@ class CitationNetwork:
36
36
  """Add citation."""
37
37
  citation = Citation(source_paper=source, target_paper=target, relation=relation)
38
38
  self.citations.append(citation)
39
+
40
+ def top_cited(self, limit: int = 3) -> list[str]:
41
+ """Return formatted labels for the most-cited papers in the network (PYSTREAMPDF-006)."""
42
+ counts: dict[str, int] = {}
43
+ for c in self.citations:
44
+ if c.relation == CitationRelation.CITES:
45
+ counts[c.target_paper] = counts.get(c.target_paper, 0) + 1
46
+ elif c.relation == CitationRelation.CITED_BY:
47
+ counts[c.source_paper] = counts.get(c.source_paper, 0) + 1
48
+ ranked = sorted(counts.items(), key=lambda item: (-item[1], item[0]))[: max(0, limit)]
49
+ results: list[str] = []
50
+ for pid, count in ranked:
51
+ meta = self.papers.get(pid, {})
52
+ title = meta.get("title") or pid
53
+ year = meta.get("year")
54
+ if year is not None:
55
+ results.append(f"{title} ({year}, {count} citations)")
56
+ else:
57
+ results.append(f"{title} ({count} citations)")
58
+ return results
@@ -6,8 +6,8 @@ from typing import Any, Optional
6
6
  class StreamPDFServer:
7
7
  """REST API server for document processing workflows."""
8
8
 
9
- def __init__(self, host: str = "0.0.0.0", port: int = 8003):
10
- """Initialize server."""
9
+ def __init__(self, host: str = "127.0.0.1", port: int = 8003):
10
+ """Initialize server (defaults to loopback 127.0.0.1)."""
11
11
  self.host = host
12
12
  self.port = port
13
13
  self.documents: dict[str, dict[str, Any]] = {}
@@ -188,8 +188,8 @@ def create_flask_app(server: Optional[StreamPDFServer] = None):
188
188
  return app
189
189
 
190
190
 
191
- def run_server(host: str = "0.0.0.0", port: int = 8003):
192
- """Run the REST API server."""
191
+ def run_server(host: str = "127.0.0.1", port: int = 8003):
192
+ """Run the REST API server (defaults to loopback 127.0.0.1)."""
193
193
  app = create_flask_app()
194
194
  app.run(host=host, port=port, debug=False)
195
195
 
File without changes
File without changes
File without changes
File without changes
File without changes