Fix TableList repr

pull/2/head
Vinayak Mehta 2018-09-27 04:42:23 +05:30
parent 00b7b2aeba
commit dfb0d4fb4c
3 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@
>>> import camelot >>> import camelot
>>> tables = camelot.read_pdf('foo.pdf') >>> tables = camelot.read_pdf('foo.pdf')
>>> tables >>> tables
<TableList tables=1> <TableList n=1>
>>> tables.export('foo.csv', f='csv', compress=True) # json, excel, html >>> tables.export('foo.csv', f='csv', compress=True) # json, excel, html
>>> tables[0] >>> tables[0]
<Table shape=(7, 7)> <Table shape=(7, 7)>

View File

@ -438,8 +438,8 @@ class TableList(object):
self._tables = tables self._tables = tables
def __repr__(self): def __repr__(self):
return '<{} tables={}>'.format( return '<{} n={}>'.format(
self.__class__.__name__, len(self._tables)) self.__class__.__name__, self.n)
def __len__(self): def __len__(self):
return len(self._tables) return len(self._tables)

View File

@ -36,7 +36,7 @@ Release v\ |version|. (:ref:`Installation <install>`)
>>> import camelot >>> import camelot
>>> tables = camelot.read_pdf('foo.pdf') >>> tables = camelot.read_pdf('foo.pdf')
>>> tables >>> tables
<TableList tables=1> <TableList n=1>
>>> tables.export('foo.csv', f='csv', compress=True) # json, excel, html >>> tables.export('foo.csv', f='csv', compress=True) # json, excel, html
>>> tables[0] >>> tables[0]
<Table shape=(7, 7)> <Table shape=(7, 7)>