py-pdf / pypdf_table_extraction

A Python library to extract tabular data from PDFs
https://camelot-py.readthedocs.io
MIT License
15 stars 7 forks source link

add __iter__() for TableList to support enumerate() #13

Open stonyw opened 3 months ago

stonyw commented 3 months ago
    tables = camelot.read_pdf(filename)
    for idx, table in enumerate(tables):   # Warining: Expected type 'Iterable[_T]', got 'TableList' instead  in pycharm
        pass
stefan6419846 commented 3 months ago

Are you able to provide a corresponding test as well?

foarsitter commented 3 months ago

I agree with @stefan6419846, your provided example is almost a test-case. Whilst the improvement looks very trivial a test-case is easy to provide.

stonyw commented 3 months ago

I'll add tests soon.