On Wednesday, July 8, 2020 at 2:39:49 PM UTC-4 [email protected] wrote:

>  After reading through the v3 design document, once thing that wasn't 
> clear to me is whether it will be possible to access just the parser 
> without running booking from the exposed API.
>
> Today, I have a workflow which:
> 1) Reads in my existing beancount files (I have many, ~ one per account) 
> using loader.load_file() and (the unexposed) loader._parse_recursive(), the 
> results of this gets categorized and preserved in memory
> 2) Parse data from PDF/OFX files which get converted into beancount objects
> 3) Run booking and validation on the new items to ensure they are complete 
> and error-free (but don't rewrite them)
> 4) Categorize these new items and append to the categorization found in (1)
> 5) Write out new beancount files retaining order/file information for the 
> items from (1), replacing the files from (1) (after backing them up of 
> course)
>
> The key here is that I never run booking on the data that gets written 
> out, because booking a transaction will create bean elements for the 
> inferred transactions, and I don't want those saved in the bean-file.  
> Additionally booking will convert CostSpec objects to Cost objects (filling 
> in the inferred info), and again, I don't want that stored in my resultant 
> beancount files.  The automation will update the beancount files, but the 
> goal is to write unmodified entries exactly as they are read such that they 
> are still easily manageable by human eyes, and preserve any manually-added 
> goodness.
>
> I realize that automating the generation of beancount files is not a 
> design-point of beancount, but I've found that it is very amenable to 
> reversing the parser process, resulting in a very effective way to enter 
> data into beancount.
>
> By implementing the parser and booking both in C++, will it still be 
> possible to run the parser, modify the results, and then (optionally) run 
> the booking and validate functions all from the python layer?
>

Have you posted your code anywhere, by chance (and, if not, would you be 
willing to)? I am very interested in your approach - I've been toying with 
a similar idea myself, but I'm not sure I've thought it through as well as 
you have.

-Aaron

-- 
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/163c0911-fa5c-4d7d-ab38-e64a0cb40fa3n%40googlegroups.com.

Reply via email to