pdf-to-csv-table-extractor 1.0.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 (22) hide show
  1. pdf_to_csv_table_extractor-1.0.0/.gitignore +33 -0
  2. pdf_to_csv_table_extractor-1.0.0/CHANGELOG.md +20 -0
  3. pdf_to_csv_table_extractor-1.0.0/LICENSE +21 -0
  4. pdf_to_csv_table_extractor-1.0.0/PKG-INFO +613 -0
  5. pdf_to_csv_table_extractor-1.0.0/README.md +570 -0
  6. pdf_to_csv_table_extractor-1.0.0/pyproject.toml +107 -0
  7. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/__init__.py +90 -0
  8. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/backends/__init__.py +25 -0
  9. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/backends/base.py +49 -0
  10. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/backends/opencv_backend.py +755 -0
  11. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/cli.py +732 -0
  12. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/cv_tables.py +690 -0
  13. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/debug_viz.py +182 -0
  14. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/exporter.py +173 -0
  15. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/hardware.py +349 -0
  16. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/languages.py +1361 -0
  17. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/models.py +530 -0
  18. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/pdf_loader.py +777 -0
  19. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/pipeline.py +207 -0
  20. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/preprocess.py +172 -0
  21. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/py.typed +1 -0
  22. pdf_to_csv_table_extractor-1.0.0/src/pdf_table_extractor/schema.py +1004 -0
@@ -0,0 +1,33 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ ENV/
16
+
17
+ # Testing & tooling
18
+ .pytest_cache/
19
+ .mypy_cache/
20
+ .ruff_cache/
21
+ .coverage
22
+ htmlcov/
23
+
24
+ # IDEs
25
+ *.iml
26
+ /.idea/
27
+ .vscode/
28
+
29
+ # Generated outputs
30
+ debug_out/
31
+ output/
32
+ benchmarks/results.json
33
+ *.tmp
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ All notable changes to `pdf-to-csv-table-extractor` will be documented in this file.
4
+
5
+ ## [1.0.0] - 2026-11-26
6
+
7
+ ### Added
8
+ - **100% local native OpenCV + RapidOCR engine + native PDF text-layer fast path** (`--text-source auto|ocr|native`, zero external OS binaries, zero cloud APIs, offline-ready, ~40×–80× faster on digital PDFs with automatic RapidOCR fallback for scans, table-ROI cropping, and `--workers` multi-page CPU parallelism).
9
+ - **Unified PDF & image ingestion** via `extract_tables()` / `extract_pdf_tables()` and `pdf2csv-tables extract`:
10
+ - Digital & scanned PDFs (`--pdf-mode render` and `--pdf-mode embedded` with logo filtering & render fallback).
11
+ - Single images (`.png`, `.jpg`, `.jpeg`, `.webp`, `.tif`, `.tiff`, `.bmp`, multi-frame TIFFs, EXIF auto-transpose).
12
+ - Multiple images and naturally sorted folders of images merged as multi-page documents.
13
+ - In-memory `bytes` and `PIL.Image.Image` inputs.
14
+ - **Multi-table detection & schema-matched grouping:**
15
+ - Bordered grid detection (ignoring prose and decorative page frames), horizontal cell merge detection, implicit sub-row splitting for unruled bands, and whitespace-aligned borderless table detection.
16
+ - Banner title promotion (`schema.title`), 2-row stacked header flattening, Unicode-safe fuzzy header matching, repeated-header deduplication (single-row, stacked, and mid-table, configurable via `--keep-repeated-headers`), and headerless cross-page continuation merging (including duplex margin-shifted scans).
17
+ - **Pythonic library outputs:** `.to_records()`, `.to_columns()`, `.to_rows()`, `.to_csv_string()`, `.to_json()`, `.to_markdown()`, lazy `.to_dataframe()` / `.to_polars()`, plus `export_csvs()` and `export_zip()`.
18
+ - **Pluggable & user-installable RapidOCR language packs:** `pdf2csv-tables languages [list|install|add|remove]`, custom ONNX recognition models + character dicts, portable `.zip`/folder packs, RTL token ordering, Python `register_language()`, and `entry_points` (`pdf_table_extractor.languages`).
19
+ - **GPU acceleration:** Automatic `--device auto|cpu|cuda|rocm` routing for NVIDIA CUDA (`onnxruntime-gpu` / PyTorch CUDA) and AMD ROCm (PyTorch ROCm HIP / ONNX Runtime MIGraphX), `pdf2csv-tables doctor`, and multi-target Docker images (`cpu`, `cuda`, `rocm`).
20
+ - **MIT License** and PEP 561 `py.typed` type annotations.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019-2026 Vitali Mogilevsky
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.