Hmm, I just ran across your older post describing ledger's architecture 
(https://groups.google.com/d/topic/ledger-cli/RSSCsSLEhwc/discussion), and 
I'm wondering if my external Python script for calculating FIFO gain/loss 
for commodities is perhaps too complex of a solution.

Would one define new valexpr vocabulary via Python functions as you 
mentioned within one's ledger file?

Where in ledger's source code can I find out about existing valexpr 
vocabulary?

I'm wondering if I could define sufficient valexpr vocabulary to build 
reporting filters to calculate and display the booking and clearing of 
commodities lots. I've built the logic in an external Python script, but 
haven't yet got it running without errors.

(I'm aware the Beancount has implemented lot management for commodities, 
but last time I looked that implementation doesn't handle my use case of 
sometimes reducing lots to a different currency than what I originally 
purchased the commodity with.)

Le mercredi 27 mars 2019 05:32:32 UTC+1, John Wiegley a écrit :
>
> >>>>> "JS" == Joel Swanson <[email protected] <javascript:>> writes: 
>
> JS> What's a valexpr function? I'm trying to understand what sorts of 
> things I 
> JS> could do by embedding python in my ledger files, but the one example 
> in 
> JS> the documentation isn't clear to me. 
>
> When you limit the computed postions, such as by --limit 'amount > 100', 
> the 
> expression used by --limit (and many other options) is called a "value 
> expression", or valexpr for short. It's an expression that always 
> evaluates to 
> a value. :) Bad name, but it stuck. 
>
> You can increase the valexpr vocabulary by defining Python functions. 
>
> John 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to