On Sat, Apr 17, 2021 at 12:40 AM Daniele Nicolodi <dani...@grinta.net>
wrote:

> On 16/04/2021 00:51, Ben Blount wrote:
> > Why not write small python scripts whenever you want to do a query?
>
> Because writing single-use Python scripts does not fit my definition of
> fun. There are much better solutions.
>
> > You
> > could have pre-written scripts with bindable parameters. You could even
> > go as far as to accept python snippets from the command line, similarly
> > to how petl does.
>
> This is not as easy as it may seem, and a DSL is always going to to
> offer a much nicer user experience than having to write a Python
> expression evaluated in an (forcefully) ill-defined context.
>
> We already have a very nice DSL to operate on Beancount ledger entries,
> I don't see why not using it, it works extremely well!
>

I agree and I disagree at the same time. Let me explain.

- Side of Agree: Yes, it has served us well, and I think it's time for that
tool to be expanded beyond Beancount to work on any data table and to
become more mature (e.g. add types). As long as we can register new
datatypes (for Amount, Position, Inventory), it should be possible.
Having the ability to run SQL on the command-line and e.g. join CSV files
or directly upload to/from Google Sheets is immensely useful.

- Side of Disagree: If I could do 95% of what it does with 10-20% more code
(e.g. Python) without having to write the processing tool itself (e.g.
using petl),
I wouldn't have written the tool in the first place. Less code to maintain.

Those things being said, I'm a huge fan of people contributing to what they
love :-)
We should have both

(Source code for the query tool has started to migrate to its own repo:
https://github.com/beancount/beanquery)

-- 
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%2BhN2%3Da6pvKguc%3D5HMBfcon6bpJWWT_W6ctU1uhR62M63RA%40mail.gmail.com.

Reply via email to