Here's how I do it (from my import script):
def process_entry(entry): ... do something... return entry def process_extracted_entries(extracted_entries_list, ledger_entries): """Filter the extracted entries to save on time.""" return [(filename, [process_entry(entry) for entry in entries], account, importer) for filename, entries, account, importer in extracted_entries_list] if __name__ == '__main__': main = Ingest(importers, hooks = [process_extracted_entries]) main() On Fri, Feb 9, 2024 at 3:46 PM Danny <dfarn...@gmail.com> wrote: > *Background* > > I've been using beancount for a few years now. I just have a couple > credits cards and a bank account, nothing especially complex, but I feel > secure knowing I have a registry of where all my money has gone. Also the > process of getting transactions into beancount is my check on spending, > letting me notice anything suspicious. > > However, its just way too labor intensive. I already use beancount-import, > but still get bogged down in hundreds of $2.90 subway payments, the grocery > store, and sandwiches from the same handful of places. > > *What I'm Looking For* > > I need a less time-consuming workflow. I discovered Red's five minute > ledger, and agree completely with the philosophy. However I think I need a > way to separate transactions from any given account into two separate > streams. > > To better illustrate, this is my ideal pipeline: > > 1. Download transactions manually or automatically where possible (csv > and ofx) > 2. Run code that has a set of predefined expense category rules (e.g. > amazon automatically to a zero-sum category, grocery store below certain > dollar value) > 3. Separate the categorized transactions and pass the remaining ones > to beancount-import > 4. Write everything to the ledger like normal > > I haven't found any examples of branching the transaction pipeline like > this, so my question is whether its even plausible within the framework of > beancount importers. My back up plan is to write a more or less hardcoded > script that will do it all, but I'm hoping for a more flexible approach! > > -- > 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 beancount+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/1d463106-57c7-447c-b374-087ab60943ddn%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/1d463106-57c7-447c-b374-087ab60943ddn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 beancount+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhOgxJu8-83Nb%3DfNSQp-7VfC0gsdX8d-%2BxL%3D6jJBOz%2B_1Q%40mail.gmail.com.