Auto-generated balance assertions are key to ensuring integrity of your imports. Ofx files typically contain balances, while csv files typically do not. Schwab is an exception: it lets you download a separate csv file that lists the current balances of each account you own. However, the resulting format means there are multiple tables (one per account) in the csv
The new "schwab_csv_balances" importer makes use of the new multitable reader. It lets you specify just the section you want to extract, and turns that section's table into balance assertions. On Monday, February 1, 2021 at 7:20:56 PM UTC-8 [email protected] wrote: > 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/e0a8a0b4-4e6d-4de9-b8ef-e5c39fa68d1bn%40googlegroups.com.
