docpluck 2.4.152__tar.gz → 2.4.158__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 (73) hide show
  1. {docpluck-2.4.152 → docpluck-2.4.158}/PKG-INFO +14 -6
  2. {docpluck-2.4.152 → docpluck-2.4.158}/README.md +13 -5
  3. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/__init__.py +32 -1
  4. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/batch.py +433 -431
  5. docpluck-2.4.158/docpluck/body.py +314 -0
  6. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/extract.py +111 -6
  7. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/extract_columns.py +422 -11
  8. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/extract_structured.py +4613 -4231
  9. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/normalize.py +1559 -63
  10. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/quality.py +41 -0
  11. docpluck-2.4.158/docpluck/references/__init__.py +217 -0
  12. docpluck-2.4.158/docpluck/references/link.py +345 -0
  13. docpluck-2.4.158/docpluck/references/parse.py +478 -0
  14. docpluck-2.4.158/docpluck/references/split.py +481 -0
  15. docpluck-2.4.158/docpluck/references/types.py +101 -0
  16. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/render.py +1028 -16
  17. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/__init__.py +234 -234
  18. docpluck-2.4.158/docpluck/sections/_reference_entries.py +84 -0
  19. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/annotators/text.py +135 -2
  20. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/core.py +679 -657
  21. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/taxonomy.py +11 -2
  22. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/__init__.py +30 -4
  23. docpluck-2.4.158/docpluck/tables/bottom_extend.py +245 -0
  24. docpluck-2.4.158/docpluck/tables/camelot_cell_join.py +364 -0
  25. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/camelot_extract.py +1508 -1363
  26. docpluck-2.4.158/docpluck/tables/camelot_row_ties.py +278 -0
  27. docpluck-2.4.158/docpluck/tables/caption_rows.py +181 -0
  28. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/captions.py +56 -0
  29. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/cell_cleaning.py +1945 -1492
  30. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/column_split.py +8 -6
  31. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/detect.py +323 -1
  32. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/docx_tables.py +0 -1
  33. docpluck-2.4.158/docpluck/tables/dropped_glyphs.py +197 -0
  34. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/flatten.py +3120 -2119
  35. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/whitespace.py +64 -2
  36. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/telemetry.py +22 -0
  37. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/version.py +506 -498
  38. {docpluck-2.4.152 → docpluck-2.4.158}/pyproject.toml +1 -1
  39. {docpluck-2.4.152 → docpluck-2.4.158}/.gitignore +0 -0
  40. {docpluck-2.4.152 → docpluck-2.4.158}/LICENSE +0 -0
  41. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/__main__.py +0 -0
  42. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/cli.py +0 -0
  43. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/extract_docx.py +0 -0
  44. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/extract_docx_structured.py +0 -0
  45. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/extract_html.py +0 -0
  46. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/extract_layout.py +0 -0
  47. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/figures/__init__.py +0 -0
  48. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/glyph_evidence.py +0 -0
  49. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/glyph_names.py +0 -0
  50. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/resources.py +0 -0
  51. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/_offsets.py +0 -0
  52. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/annotators/__init__.py +0 -0
  53. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/annotators/docx.py +0 -0
  54. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/annotators/html.py +0 -0
  55. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/annotators/pdf.py +0 -0
  56. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/blocks.py +0 -0
  57. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/boundaries.py +0 -0
  58. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/sections/types.py +0 -0
  59. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/symbols.py +0 -0
  60. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/arm_spans.py +0 -0
  61. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/bbox_utils.py +0 -0
  62. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/cell_geometry.py +0 -0
  63. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/cluster.py +0 -0
  64. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/confidence.py +0 -0
  65. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/notes.py +0 -0
  66. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/render.py +0 -0
  67. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tables/rotated.py +0 -0
  68. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/tempfiles.py +0 -0
  69. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/testing/__init__.py +0 -0
  70. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/testing/_root.py +0 -0
  71. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/testing/corpus.py +0 -0
  72. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/testing/corpus_manifest.py +0 -0
  73. {docpluck-2.4.152 → docpluck-2.4.158}/docpluck/testing/regenerate.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: docpluck
3
- Version: 2.4.152
3
+ Version: 2.4.158
4
4
  Summary: PDF, DOCX, and HTML text extraction and normalization for academic papers
5
5
  Project-URL: Homepage, https://docpluck.app
6
6
  Project-URL: Documentation, https://docpluck.app/api-docs
@@ -126,7 +126,7 @@ Requires Python 3.10 or newer.
126
126
  pip install "docpluck[all] @ git+https://github.com/giladfeldman/docpluck.git"
127
127
  ```
128
128
 
129
- To pin a release, append its tag: `...docpluck.git@v2.4.152`. The package is also on PyPI
129
+ To pin a release, append its tag: `...docpluck.git@v2.4.158`. The package is also on PyPI
130
130
  (`pip install docpluck`); the GitHub tags are the release of record and PyPI can trail them,
131
131
  so check `pip index versions docpluck` if you need a specific version from PyPI.
132
132
 
@@ -274,6 +274,14 @@ of interest, data availability, author contributions), references, appendix, sup
274
274
  material and footnotes. `SECTIONING_VERSION` versions the algorithm; `sectioning_text_id`
275
275
  fingerprints the text buffer the offsets index into.
276
276
 
277
+ ### Body text without the bibliography
278
+
279
+ `extract_pdf_body(pdf_bytes)` returns `(body, report)`: the layout-aware normalized text with
280
+ the reference list removed (headed, German `Literatur`, or an unheaded numbered list), and
281
+ `body_scope_text(text)` does the same cut on text you already have. A references section ends
282
+ where its entry-shaped lines end, so body text placed after the bibliography is kept.
283
+ `report.removed` lists every span taken out. Nothing else changes.
284
+
277
285
  ### Tables and figures
278
286
 
279
287
  `extract_pdf_structured(pdf_bytes, *, thorough=False, table_text_mode="raw")` and
@@ -296,7 +304,7 @@ fingerprints the text buffer the offsets index into.
296
304
 
297
305
  `flatten_tables_for_paper(tables)` (or `flatten_table(table)` for one) turns each body row of
298
306
  each table into a `FlattenedRow`: its table, page, row label, header, cells, an English sentence
299
- (`"Importance: t(741) = 3.93, p < .001, d = 0.29"`) and parsed `fields`. This is the input
307
+ (`"Importance: t(741) = 3.93, p < .001, d = 0.29"`) and parsed `fields`. A confidence interval is stated at the level the table prints (`90% CI`, `95% CrI`; a bare `CI` when none is stated), and `fields["CI_level"]` carries that level when present, with `fields["CI_kind"]` (`CI`, `CrI` or `HDI`); `fields["p_text"]` carries the p-value exactly as printed (`".050"` beside `p` = 0.05), and `fields_raw` carries every typed number as printed, keyed like `fields` (`fields_raw["t"]` = `"-1.40"`); descriptive cells (`M (SD)`, `b (SE)`, `n (%)`) are typed as `M`/`SD`, `est`/`SE` or `count`/`pct` only when the table states what the parentheses hold, one record per arm column with its `group`; a printed inequality on any other statistic travels as `<key>_op` (`fields["eta2_op"]` = `"<"` for `< 0.001`). This is the input
300
308
  format for downstream statistics checkers; the CLI writes it as JSON Lines with
301
309
  `render --tables-jsonl`. `render_flattened_inline(rows, table_id=...)` renders rows back as a
302
310
  Markdown block.
@@ -365,13 +373,13 @@ Options for `render`:
365
373
  ## Configuration
366
374
 
367
375
  docpluck reads no configuration files. These environment variables change behaviour; all
368
- default to off.
376
+ default to off except `DOCPLUCK_COLUMN_CORRECT_GENERAL`, which is on unless set to `0`.
369
377
 
370
378
  | variable | effect when set to `1` |
371
379
  |---|---|
372
380
  | `DOCPLUCK_FALLBACK_LOG` | print every fallback event to standard error as it happens |
373
381
  | `DOCPLUCK_DISABLE_CAMELOT` | skip Camelot; tables then come only from the non-Camelot paths |
374
- | `DOCPLUCK_COLUMN_CORRECT_GENERAL` | experimental: apply two-column re-ordering to more pages (still gated on a clean central gutter and on every word surviving) |
382
+ | `DOCPLUCK_COLUMN_CORRECT_GENERAL` | on by default; `0` turns it off. Re-orders a two-column page that pdftotext interleaved, left column then right, only when the page has a clean central gutter and every word survives. A full-width table above or below the columns is read in place; a page that is a table across the gutter, or two-column blocks stacked apart or in different type, keeps its order |
375
383
  | `DOCPLUCK_COLUMN_CORRECT_BANDED` | experimental: per-band re-extraction for mixed-layout pages the whole-page corrector skips |
376
384
  | `DOCPLUCK_RCT_L2_BYPASS` | diagnostic only: disables two table-region guards, for measuring their effect |
377
385
 
@@ -423,7 +431,7 @@ default to off.
423
431
  If you use docpluck in research, cite the version you used (from `get_version_info()`):
424
432
 
425
433
  > Feldman, G. (2026). *docpluck: Text and statistic extraction from academic papers*
426
- > (Version 2.4.152) [Computer software]. https://github.com/giladfeldman/docpluck
434
+ > (Version 2.4.158) [Computer software]. https://github.com/giladfeldman/docpluck
427
435
 
428
436
  Machine-readable metadata is in [CITATION.cff](CITATION.cff); GitHub's "Cite this repository"
429
437
  button reads it.
@@ -75,7 +75,7 @@ Requires Python 3.10 or newer.
75
75
  pip install "docpluck[all] @ git+https://github.com/giladfeldman/docpluck.git"
76
76
  ```
77
77
 
78
- To pin a release, append its tag: `...docpluck.git@v2.4.152`. The package is also on PyPI
78
+ To pin a release, append its tag: `...docpluck.git@v2.4.158`. The package is also on PyPI
79
79
  (`pip install docpluck`); the GitHub tags are the release of record and PyPI can trail them,
80
80
  so check `pip index versions docpluck` if you need a specific version from PyPI.
81
81
 
@@ -223,6 +223,14 @@ of interest, data availability, author contributions), references, appendix, sup
223
223
  material and footnotes. `SECTIONING_VERSION` versions the algorithm; `sectioning_text_id`
224
224
  fingerprints the text buffer the offsets index into.
225
225
 
226
+ ### Body text without the bibliography
227
+
228
+ `extract_pdf_body(pdf_bytes)` returns `(body, report)`: the layout-aware normalized text with
229
+ the reference list removed (headed, German `Literatur`, or an unheaded numbered list), and
230
+ `body_scope_text(text)` does the same cut on text you already have. A references section ends
231
+ where its entry-shaped lines end, so body text placed after the bibliography is kept.
232
+ `report.removed` lists every span taken out. Nothing else changes.
233
+
226
234
  ### Tables and figures
227
235
 
228
236
  `extract_pdf_structured(pdf_bytes, *, thorough=False, table_text_mode="raw")` and
@@ -245,7 +253,7 @@ fingerprints the text buffer the offsets index into.
245
253
 
246
254
  `flatten_tables_for_paper(tables)` (or `flatten_table(table)` for one) turns each body row of
247
255
  each table into a `FlattenedRow`: its table, page, row label, header, cells, an English sentence
248
- (`"Importance: t(741) = 3.93, p < .001, d = 0.29"`) and parsed `fields`. This is the input
256
+ (`"Importance: t(741) = 3.93, p < .001, d = 0.29"`) and parsed `fields`. A confidence interval is stated at the level the table prints (`90% CI`, `95% CrI`; a bare `CI` when none is stated), and `fields["CI_level"]` carries that level when present, with `fields["CI_kind"]` (`CI`, `CrI` or `HDI`); `fields["p_text"]` carries the p-value exactly as printed (`".050"` beside `p` = 0.05), and `fields_raw` carries every typed number as printed, keyed like `fields` (`fields_raw["t"]` = `"-1.40"`); descriptive cells (`M (SD)`, `b (SE)`, `n (%)`) are typed as `M`/`SD`, `est`/`SE` or `count`/`pct` only when the table states what the parentheses hold, one record per arm column with its `group`; a printed inequality on any other statistic travels as `<key>_op` (`fields["eta2_op"]` = `"<"` for `< 0.001`). This is the input
249
257
  format for downstream statistics checkers; the CLI writes it as JSON Lines with
250
258
  `render --tables-jsonl`. `render_flattened_inline(rows, table_id=...)` renders rows back as a
251
259
  Markdown block.
@@ -314,13 +322,13 @@ Options for `render`:
314
322
  ## Configuration
315
323
 
316
324
  docpluck reads no configuration files. These environment variables change behaviour; all
317
- default to off.
325
+ default to off except `DOCPLUCK_COLUMN_CORRECT_GENERAL`, which is on unless set to `0`.
318
326
 
319
327
  | variable | effect when set to `1` |
320
328
  |---|---|
321
329
  | `DOCPLUCK_FALLBACK_LOG` | print every fallback event to standard error as it happens |
322
330
  | `DOCPLUCK_DISABLE_CAMELOT` | skip Camelot; tables then come only from the non-Camelot paths |
323
- | `DOCPLUCK_COLUMN_CORRECT_GENERAL` | experimental: apply two-column re-ordering to more pages (still gated on a clean central gutter and on every word surviving) |
331
+ | `DOCPLUCK_COLUMN_CORRECT_GENERAL` | on by default; `0` turns it off. Re-orders a two-column page that pdftotext interleaved, left column then right, only when the page has a clean central gutter and every word survives. A full-width table above or below the columns is read in place; a page that is a table across the gutter, or two-column blocks stacked apart or in different type, keeps its order |
324
332
  | `DOCPLUCK_COLUMN_CORRECT_BANDED` | experimental: per-band re-extraction for mixed-layout pages the whole-page corrector skips |
325
333
  | `DOCPLUCK_RCT_L2_BYPASS` | diagnostic only: disables two table-region guards, for measuring their effect |
326
334
 
@@ -372,7 +380,7 @@ default to off.
372
380
  If you use docpluck in research, cite the version you used (from `get_version_info()`):
373
381
 
374
382
  > Feldman, G. (2026). *docpluck: Text and statistic extraction from academic papers*
375
- > (Version 2.4.152) [Computer software]. https://github.com/giladfeldman/docpluck
383
+ > (Version 2.4.158) [Computer software]. https://github.com/giladfeldman/docpluck
376
384
 
377
385
  Machine-readable metadata is in [CITATION.cff](CITATION.cff); GitHub's "Cite this repository"
378
386
  button reads it.
@@ -99,8 +99,23 @@ from .extract_structured import TABLE_EXTRACTION_VERSION, StructuredResult, extr
99
99
  # docs/BENCHMARKS_docx_engines_2026-09.md.
100
100
  from .extract_docx_structured import extract_docx_structured
101
101
  from .render import RenderReport, render_pdf_to_markdown
102
+ from .body import BODY_SCOPE_VERSION, BodyScopeReport, body_scope_text, extract_pdf_body
103
+ # Reference entries and in-text citation linking (v2.4.155). Additive: nothing
104
+ # else reads it, and it reads only extract_sections' output.
105
+ from .references import (
106
+ REFERENCES_VERSION,
107
+ Citation,
108
+ CitationAnalysis,
109
+ Reference,
110
+ ReferenceAuthor,
111
+ extract_citations,
112
+ extract_references,
113
+ link_citations,
114
+ parse_reference,
115
+ parse_references,
116
+ )
102
117
 
103
- __version__ = "2.4.152"
118
+ __version__ = "2.4.158"
104
119
  __author__ = "Gilad Feldman"
105
120
  __license__ = "MIT"
106
121
 
@@ -123,6 +138,11 @@ __all__ = [
123
138
  "NORMALIZATION_VERSION",
124
139
  # Quality
125
140
  "compute_quality_score",
141
+ # Body scope (v2.4.155): the text without its reference list
142
+ "extract_pdf_body",
143
+ "body_scope_text",
144
+ "BodyScopeReport",
145
+ "BODY_SCOPE_VERSION",
126
146
  # Batch
127
147
  "ExtractionFileResult",
128
148
  "ExtractionReport",
@@ -154,6 +174,17 @@ __all__ = [
154
174
  "flatten_table",
155
175
  "flatten_tables_for_paper",
156
176
  "render_flattened_inline",
177
+ # References and citations (v2.4.155)
178
+ "extract_references",
179
+ "extract_citations",
180
+ "parse_reference",
181
+ "parse_references",
182
+ "link_citations",
183
+ "Reference",
184
+ "ReferenceAuthor",
185
+ "Citation",
186
+ "CitationAnalysis",
187
+ "REFERENCES_VERSION",
157
188
  # Markdown rendering (v2.2)
158
189
  "render_pdf_to_markdown",
159
190
  # v2.4.130: opt-in telemetry for the markdown post-process chain.