Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b310f16dba | |||
| defaead679 | |||
| a60ce38d4d |
@@ -4,6 +4,14 @@ Release History
|
|||||||
master
|
master
|
||||||
------
|
------
|
||||||
|
|
||||||
|
0.3.2 (2018-11-04)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* [#186](https://github.com/socialcopsdev/camelot/issues/186) Add `_bbox` attribute to table. [#193](https://github.com/socialcopsdev/camelot/pull/193) by Vinayak Mehta.
|
||||||
|
* You can use `table._bbox` to get coordinates of the detected table.
|
||||||
|
|
||||||
0.3.1 (2018-11-02)
|
0.3.1 (2018-11-02)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
VERSION = (0, 3, 1)
|
VERSION = (0, 3, 2)
|
||||||
|
|
||||||
__title__ = 'camelot-py'
|
__title__ = 'camelot-py'
|
||||||
__description__ = 'PDF Table Extraction for Humans.'
|
__description__ = 'PDF Table Extraction for Humans.'
|
||||||
|
|||||||
@@ -362,6 +362,7 @@ class Lattice(BaseParser):
|
|||||||
self.table_bbox.keys(), key=lambda x: x[1], reverse=True)):
|
self.table_bbox.keys(), key=lambda x: x[1], reverse=True)):
|
||||||
cols, rows, v_s, h_s = self._generate_columns_and_rows(table_idx, tk)
|
cols, rows, v_s, h_s = self._generate_columns_and_rows(table_idx, tk)
|
||||||
table = self._generate_table(table_idx, cols, rows, v_s=v_s, h_s=h_s)
|
table = self._generate_table(table_idx, cols, rows, v_s=v_s, h_s=h_s)
|
||||||
|
table._bbox = tk
|
||||||
_tables.append(table)
|
_tables.append(table)
|
||||||
|
|
||||||
return _tables
|
return _tables
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ class Stream(BaseParser):
|
|||||||
self.table_bbox.keys(), key=lambda x: x[1], reverse=True)):
|
self.table_bbox.keys(), key=lambda x: x[1], reverse=True)):
|
||||||
cols, rows = self._generate_columns_and_rows(table_idx, tk)
|
cols, rows = self._generate_columns_and_rows(table_idx, tk)
|
||||||
table = self._generate_table(table_idx, cols, rows)
|
table = self._generate_table(table_idx, cols, rows)
|
||||||
|
table._bbox = tk
|
||||||
_tables.append(table)
|
_tables.append(table)
|
||||||
|
|
||||||
return _tables
|
return _tables
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ You can pass the column separators as a list of comma-separated strings to :meth
|
|||||||
|
|
||||||
In case you passed a single column separators string list, and no table area is specified, the separators will be applied to the whole page. When a list of table areas is specified and you need to specify column separators as well, **the length of both lists should be equal**. Each table area will be mapped to each column separators' string using their indices.
|
In case you passed a single column separators string list, and no table area is specified, the separators will be applied to the whole page. When a list of table areas is specified and you need to specify column separators as well, **the length of both lists should be equal**. Each table area will be mapped to each column separators' string using their indices.
|
||||||
|
|
||||||
For example, if you have specified two table areas, ``table_areas=['12,23,43,54', '20,33,55,67']``, and only want to specify column separators for the first table, you can pass an empty string for the second table in the column separators' list like this, ``columns=['10,120,200,400', '']``.
|
For example, if you have specified two table areas, ``table_areas=['12,54,43,23', '20,67,55,33']``, and only want to specify column separators for the first table, you can pass an empty string for the second table in the column separators' list like this, ``columns=['10,120,200,400', '']``.
|
||||||
|
|
||||||
Let's get back to the *x* coordinates we got from plotting the text that exists on this `PDF <../_static/pdf/column_separators.pdf>`__, and get the table out!
|
Let's get back to the *x* coordinates we got from plotting the text that exists on this `PDF <../_static/pdf/column_separators.pdf>`__, and get the table out!
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user