Using pandas with beancount

145 views
Skip to first unread message

Chary Chary

unread,
Jun 2, 2019, 11:12:57 AM6/2/19
to Beancount
Hello everybody,

I am just wondering whether there is possibility to use a broad python data analysis tools (like pandas) with beancount?

Importing data in pandas and then analyzing it using pandas further?

Or the answer is the same as with SQL, that pandas are not good for double entry accounting type of data?

Uwe Ziegenhagen

unread,
Jun 2, 2019, 11:23:03 AM6/2/19
to bean...@googlegroups.com
I am currently thinking on how to get my transaction data from my bank accounts into beancount. I can get my bank statements via HBCI into pandas, from there I create the imports. I'll post the code once I am done with it.

Uwe

--
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+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/895c4f02-7b07-406b-898f-f6d4e0dc4933%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Dr. Uwe Ziegenhagen

Chary Chary

unread,
Jun 2, 2019, 11:48:02 AM6/2/19
to Beancount
Uwe,

I was actually thinking other way around: get transactions (checked and verified by beancount) into pandas and process them further in pandas


On Sunday, June 2, 2019 at 5:23:03 PM UTC+2, Uwe Ziegenhagen wrote:
I am currently thinking on how to get my transaction data from my bank accounts into beancount. I can get my bank statements via HBCI into pandas, from there I create the imports. I'll post the code once I am done with it.

Uwe

Am So., 2. Juni 2019 um 17:12 Uhr schrieb Chary Chary <char...@gmail.com>:
Hello everybody,

I am just wondering whether there is possibility to use a broad python data analysis tools (like pandas) with beancount?

Importing data in pandas and then analyzing it using pandas further?

Or the answer is the same as with SQL, that pandas are not good for double entry accounting type of data?

--
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 bean...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/895c4f02-7b07-406b-898f-f6d4e0dc4933%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

francois PEGORY

unread,
Jun 2, 2019, 11:55:21 AM6/2/19
to Beancount
Currently I do by exporting CSV from beancoumt then importing in  panda 

To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

Chary Chary

unread,
Jun 2, 2019, 12:00:15 PM6/2/19
to Beancount
francois,

thanks. Would be interesting to know how you combine functionality of beancount and pandas?


  • what do you use beancount for
  • what do you use pandas for

Andrzej

unread,
Jun 2, 2019, 2:41:19 PM6/2/19
to Beancount

I use pandas to do some analysis of my beancount file. I use beancount query mechanism to extract interesting entries and then stuff them into dataframe. I typed example below (beware, I didn't test it and I'm not doing error checking)


from beancount import loader
from beancount.query import query
import pandas as pd
q = "SELECT account, date, number WHERE year = {}"
entries, errors, options_map = loader.load_file(PATH_TO_FILE)
rtypes, rrows = query.run_query(entries, options_map, q, 2019)
df = pd.DataFrame(rrows)
...

Reply all
Reply to author
Forward
0 new messages