Hey Nasko, Yes plugins are intended to be ephemeral transformations / validations on the ledger. It reads the ledger file(s) on disk, and applies plugins to the in-memory representation of the ledger.
My recommendation is to think of your ledger as a pipeline. Some stages of it can be ephemeral and regenerated on demand. One way to achieve this with importing is to use multiple ledger files that are included <https://beancount.github.io/docs/beancount_language_syntax.html#includes> from the main ledger file. Some of those ledgers could be completely regenerated on demand by an importer, others would be for your manual transactions. You can also break them down by year, which can be handy for if your ledger gets large and you want to speed up parsing. The approach that I've seen most often is that the importers are run and permanently merge their new transactions into the ledger. beancount-import <https://github.com/jbms/beancount-import> has a web-ui for this, while Fava's importer / beangulp use commands to import all transactions from the importer at once. On Mon, Oct 3, 2022, 21:14 Nasko Oskov <[email protected]> wrote: > Hey folks, > I'm trying to wrap my mind around the different parts of beancount in > order to automate the import of my Amazon purchases. Using their Chase card > allows me to have a mapping from a credit card transaction to Amazon order > id. From Amazon, I can download a csv file with all items with their order > ids. > > If I use an importer, then I can get the ofx file to generate > transactions, but it doesn't have any other information than the > transaction payee and the amount. I decided to write a plugin that takes > each transaction and maps the payee to order id, so I can record this as > metadata. > > The problem I'm hitting is that plugin transforms transactions when they > are fed into tools, but does not update my beancount file. I assume this is > because the beancount file is source of truth and we want it to be as > immutable as possible. Am I correct in my understanding? > Importer seems to be the right place to combine all the bits of data > together to generate the transaction correctly from the very get go, but > that means I can't use either beancount-import or beancount-reds-importers > as easily. > > Any suggestions on how to approach solving this? > Thanks in advance! > Nasko > > P.S. Ideally, I'd integrate smart_import so I can train it on the data, > since a bunch of transactions are repetitive. > > -- > 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/5d6ddfbb-5cd5-4994-b17f-fd98a2817c89n%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/5d6ddfbb-5cd5-4994-b17f-fd98a2817c89n%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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CACGEkZun%2B7U8XROtgAi8%2BV%3DsAZLgPBKStbfaYvM30Cxf5QAA8g%40mail.gmail.com.
