Alen,

you need to use run_query

from beanquery.query import run_query


You can see how it is done here for instance

https://colab.research.google.com/drive/17Mbk2JC4KHMg3b1iXoZg-50kEI2bCoQ-?usp=drive_link

On Monday, May 12, 2025 at 5:16:22 PM UTC+2 Alen Šiljak wrote:

> Hi all! As I managed to port all my data, I am now adapting the tooling I 
> built around it, before I can fully switch to Beancount. I would highly 
> appreciate the assistance from the helpful people in this group.
>
> I will post the questions separately so that they are easier to track.
>
> The first question is - how to query Beancount from a Python application?
>
> To provide some context - I am using Cashier for quick overview and 
> transaction entry on my phone. I use Cashier Server to synchronize the 
> balances from the book. Cashier Server is a Python application. This used 
> to forward queries to ledger and return the data back. Now, with Beancount, 
> I would assume that it can execute those directly via Python and not run 
> any external processes.
> So, if I manage to identify the BQL queries I need to get accounts, 
> balances, payees, and whatever else, how would I run them from an external 
> app?
> I have Python experience but I have not worked with any Beancount tools 
> yet. I've looked briefly into what's available and tried bean-query.
>
> Thank you for any pointers!
>

-- 
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 visit 
https://groups.google.com/d/msgid/beancount/5465ae00-5ba4-477b-ab24-3976d04d121en%40googlegroups.com.

Reply via email to