Continuing this series, I've added file format readers to read csv 
<https://github.com/redstreet/beancount_reds_importers/blob/master/beancount_reds_importers/libimport/csv_multitable_reader.py>
 
and xlsx 
<https://github.com/redstreet/beancount_reds_importers/blob/master/beancount_reds_importers/libimport/xlsx_multitable_reader.py>
 
files with multiple tables. This seems to be a common format I've come 
across from multiple providers.

Annoyingly, there is no standard specification or even a sane way that all 
providers follow. This reader assumes that any line with a single field 
marks the beginning of a new section, with that field as the title of the 
section. The next line is assumed to be the header for that new section.

This is a file format reader for beancount_reds_importers that converts:
---- examples.csv -----
downloaded on: blah blah
section1
date,transactions,amount
2020-02-02,3,5.00
2020-02-02,3,5.00
section2
account_num,balance,date
123123,1000,2020-12-31
23048,2000,2020-12-31
end_of_file
-----------------------

to this data structure:
self.alltables =  {'section1': <petl table of section 1>
                   'section2': <petl table of section 2>
                  }

where each value is a petl table.


This file format is common enough to warrant this reader.
The xlsx_multitable reader is built on top of this reader

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/4b5050de-ba4d-481a-9483-512f993ed172n%40googlegroups.com.

Reply via email to