Hi all,

I'm still relatively new to all of the Beancount specific language and I'm 
trying to wrap my head around how to understand an inventory and positions. 
I'm writing a Python script in which I am attempting to build a list of 
accounts and their respective balances. The initial bit looks like this:

entries, errors, options = loader.load_file(os.path.join(root, main_file))
accounts = realization.realize(entries)
for account in realization.iter_children(accounts, True):
# TODO

>From the above, I can access "account.balance" which is an instance of an 
Inventory. This is where things get a little confusing for me. My Beancount 
setup is very simple, only tracking transactions in a few dozen accounts 
and all in one currency. This leads me to believe that I can use the 
"get_currency_units" method in the Inventory class in order to get the 
account balance in my default unit (USD) for each account. The problem I 
ran into is that if the balance is 0.00 USD the aforementioned method 
returns nothing as do all other Inventory methods that involve calculating 
a value. The account has transactions in it, they just happen to equate to 
0.00. This makes me wonder if I understand what a position is and if I'm 
even on the right path to calculate an account balance. Is it safe for me 
to assume that if it returns nothing that the balance must then be 0.00? 
But how do I know that it's 0.00 in USD? Any help or clarification is 
appreciated! 

-- 
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/83726537-9577-4bbf-ad8c-bef7b62d771an%40googlegroups.com.

Reply via email to