Skip to content

Commit

Permalink
add python example to find parse and serialize tables from a directory (
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPappalardo authored Oct 16, 2024
1 parent d4ee985 commit 1fed2cf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ You can also use eparse from python like so:
106 45107 32801.363072 45199 841656.13896
...
For example, to find and print cells from any "Principal Repayment" columns in excel files in the "tests" directory, you would:

.. code-block::
from pathlib import Path
from eparse.core import get_df_from_file, df_serialize_table
for f in Path("tests").iterdir():
if f.is_file() and "xls" in f.name:
for table in get_df_from_file(f):
for row in df_serialize_table(table[0]):
if row["c_header"] == "Principal Repayment":
print(row)
Scan
----
Expand Down

0 comments on commit 1fed2cf

Please sign in to comment.