tabula-py 2.9.1__tar.gz → 2.9.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.
- tabula_py-2.9.2/.github/FUNDING.yml +2 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.github/ISSUE_TEMPLATE/Bug_report.yaml +9 -1
- {tabula_py-2.9.1 → tabula_py-2.9.2}/PKG-INFO +1 -1
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/backend.py +1 -1
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/util.py +6 -5
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula_py.egg-info/PKG-INFO +1 -1
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/test_read_pdf_table.py +9 -0
- tabula_py-2.9.1/.github/FUNDING.yml +0 -2
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.github/CONTRIBUTING.md +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.github/ISSUE_TEMPLATE/Custom.md +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.github/ISSUE_TEMPLATE/Feature_request.yaml +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.github/workflows/pythonpublish.yml +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.github/workflows/pythontest.yml +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.gitignore +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/.pre-commit-config.yaml +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/LICENSE +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/MANIFEST.in +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/README.md +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/Makefile +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/conf.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/contributing.rst +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/faq.rst +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/getting_started.rst +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/index.rst +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/make.bat +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/tabula.errors.rst +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/docs/tabula.rst +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/example.png +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/examples/data.pdf +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/examples/data.tabula-template.json +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/examples/tabula_example.ipynb +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/examples/test.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/examples/test.json +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/examples/test.tsv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/noxfile.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/pyproject.toml +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/readthedocs.yaml +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/setup.cfg +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/__init__.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/errors/__init__.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/file_util.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/io.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/py.typed +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/tabula-1.0.5-jar-with-dependencies.jar +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula/template.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula_py.egg-info/SOURCES.txt +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula_py.egg-info/dependency_links.txt +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula_py.egg-info/requires.txt +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tabula_py.egg-info/top_level.txt +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/12s0324.pdf +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/MultiColumn.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/MultiColumn.pdf +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/campaign_donors.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/campaign_donors.pdf +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data.pdf +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data.tabula-template.json +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_1-3.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_1.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_1.json +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_1.tsv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_2-3.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_dtype.pdf +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_dtype.tabula-template.json +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_dtype_expected.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/resources/data_dtype_template_expected.csv +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/test_read_pdf_jar_path.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/test_read_pdf_silent.py +0 -0
- {tabula_py-2.9.1 → tabula_py-2.9.2}/tests/test_util.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
name: Bug report
|
|
2
2
|
description: File a bug report
|
|
3
3
|
title: "[BUG] <title>"
|
|
4
|
-
labels: ["
|
|
4
|
+
labels: ["triage"]
|
|
5
5
|
body:
|
|
6
6
|
- type: input
|
|
7
7
|
id: summary
|
|
@@ -19,6 +19,14 @@ body:
|
|
|
19
19
|
options:
|
|
20
20
|
- label: I have read the FAQ
|
|
21
21
|
required: true
|
|
22
|
+
- type: checkboxes
|
|
23
|
+
id: issues
|
|
24
|
+
attributes:
|
|
25
|
+
label: Did you search GitHub issues?
|
|
26
|
+
description: Please search the [discussions](https://github.com/chezou/tabula-py/issues)
|
|
27
|
+
options:
|
|
28
|
+
- label: I have searched the issues
|
|
29
|
+
required: true
|
|
22
30
|
- type: checkboxes
|
|
23
31
|
id: discussions
|
|
24
32
|
attributes:
|
|
@@ -54,7 +54,7 @@ class TabulaVm:
|
|
|
54
54
|
|
|
55
55
|
except (ModuleNotFoundError, ImportError) as e:
|
|
56
56
|
logger.warning(
|
|
57
|
-
"
|
|
57
|
+
"Failed to import jpype dependencies. Fallback to subprocess."
|
|
58
58
|
)
|
|
59
59
|
logger.warning(e)
|
|
60
60
|
self.tabula = None
|
|
@@ -9,7 +9,7 @@ import platform
|
|
|
9
9
|
import shlex
|
|
10
10
|
from dataclasses import dataclass
|
|
11
11
|
from logging import getLogger
|
|
12
|
-
from typing import IO, Iterable, List, Optional, Union, cast
|
|
12
|
+
from typing import IO, Iterable, List, Optional, Sequence, Union, cast
|
|
13
13
|
|
|
14
14
|
logger = getLogger(__name__)
|
|
15
15
|
|
|
@@ -115,8 +115,9 @@ class TabulaOption:
|
|
|
115
115
|
Password to decrypt document. Default: empty
|
|
116
116
|
silent (bool, optional):
|
|
117
117
|
Suppress all stderr output.
|
|
118
|
-
columns (
|
|
119
|
-
X coordinates of column boundaries.
|
|
118
|
+
columns (Sequence, optional):
|
|
119
|
+
X coordinates of column boundaries. Must be sorted and of a datatype that
|
|
120
|
+
preserves order, e.g. tuple or list
|
|
120
121
|
|
|
121
122
|
Example:
|
|
122
123
|
``[10.1, 20.2, 30.3]``
|
|
@@ -147,7 +148,7 @@ class TabulaOption:
|
|
|
147
148
|
stream: bool = False
|
|
148
149
|
password: Optional[str] = None
|
|
149
150
|
silent: Optional[bool] = None
|
|
150
|
-
columns: Optional[
|
|
151
|
+
columns: Optional[Sequence[float]] = None
|
|
151
152
|
relative_columns: bool = False
|
|
152
153
|
format: Optional[str] = None
|
|
153
154
|
batch: Optional[str] = None
|
|
@@ -235,7 +236,7 @@ class TabulaOption:
|
|
|
235
236
|
__options += ["--outfile", self.output_path]
|
|
236
237
|
|
|
237
238
|
if self.columns:
|
|
238
|
-
if self.columns != sorted(self.columns):
|
|
239
|
+
if list(self.columns) != sorted(self.columns):
|
|
239
240
|
raise ValueError("columns option should be sorted")
|
|
240
241
|
|
|
241
242
|
__columns = _format_with_relative(self.columns, self.relative_columns)
|
|
@@ -91,6 +91,15 @@ class TestReadPdfTable(unittest.TestCase):
|
|
|
91
91
|
)[0].equals(pd.read_csv(expected_csv))
|
|
92
92
|
)
|
|
93
93
|
|
|
94
|
+
def test_read_pdf_with_tuple_columns(self):
|
|
95
|
+
pdf_path = "tests/resources/campaign_donors.pdf"
|
|
96
|
+
expected_csv = "tests/resources/campaign_donors.csv"
|
|
97
|
+
self.assertTrue(
|
|
98
|
+
tabula.read_pdf(
|
|
99
|
+
pdf_path, columns=(47, 147, 256, 310, 375, 431, 504), guess=False
|
|
100
|
+
)[0].equals(pd.read_csv(expected_csv))
|
|
101
|
+
)
|
|
102
|
+
|
|
94
103
|
def test_read_pdf_with_relative_columns(self):
|
|
95
104
|
pdf_path = "tests/resources/campaign_donors.pdf"
|
|
96
105
|
expected_csv = "tests/resources/campaign_donors.csv"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|