Renames the keyword table_area to table_areas (#171)

`table_areas` sounds more apt since it is a list and there can be
multiple table areas on a page.

Closes #165
This commit is contained in:
Parth P Panchal
2018-10-24 23:06:53 +05:30
committed by Vinayak Mehta
parent 8205e0e9ab
commit 32df09ad1c
8 changed files with 33 additions and 33 deletions
+2 -2
View File
@@ -81,7 +81,7 @@ data_stream_table_rotated = [
["", "", "", "", "", "", "", "", "54", "", "", "", "", "", "", "", "", ""]
]
data_stream_table_area = [
data_stream_table_areas = [
["", "One Withholding"],
["Payroll Period", "Allowance"],
["Weekly", "$71.15"],
@@ -261,7 +261,7 @@ data_lattice_table_rotated = [
["Pooled", "38742", "53618", "60601", "86898", "4459", "21918", "27041", "14312", "18519"]
]
data_lattice_table_area = [
data_lattice_table_areas = [
["", "", "", "", "", "", "", "", ""],
["State", "n", "Literacy Status", "", "", "", "", "", ""],
["", "", "Illiterate", "Read & Write", "1-4 std.", "5-8 std.", "9-12 std.", "College", ""],
+6 -6
View File
@@ -45,11 +45,11 @@ def test_stream_table_rotated():
assert df.equals(tables[0].df)
def test_stream_table_area():
df = pd.DataFrame(data_stream_table_area)
def test_stream_table_areas():
df = pd.DataFrame(data_stream_table_areas)
filename = os.path.join(testdir, "tabula/us-007.pdf")
tables = camelot.read_pdf(filename, flavor="stream", table_area=["320,500,573,335"])
tables = camelot.read_pdf(filename, flavor="stream", table_areas=["320,500,573,335"])
assert df.equals(tables[0].df)
@@ -100,11 +100,11 @@ def test_lattice_table_rotated():
assert df.equals(tables[0].df)
def test_lattice_table_area():
df = pd.DataFrame(data_lattice_table_area)
def test_lattice_table_areas():
df = pd.DataFrame(data_lattice_table_areas)
filename = os.path.join(testdir, "twotables_2.pdf")
tables = camelot.read_pdf(filename, table_area=["80,693,535,448"])
tables = camelot.read_pdf(filename, table_areas=["80,693,535,448"])
assert df.equals(tables[0].df)
+2 -2
View File
@@ -34,11 +34,11 @@ def test_unsupported_format():
def test_stream_equal_length():
message = ("Length of table_area and columns"
message = ("Length of table_areas and columns"
" should be equal")
with pytest.raises(ValueError, message=message):
tables = camelot.read_pdf(filename, flavor='stream',
table_area=['10,20,30,40'], columns=['10,20,30,40', '10,20,30,40'])
table_areas=['10,20,30,40'], columns=['10,20,30,40', '10,20,30,40'])
def test_no_tables_found():