Importing CSV Transaction with Categories?

159 views
Skip to first unread message

Omar Sandoval

unread,
Mar 1, 2018, 1:37:40 PM3/1/18
to Beancount
Hi everyone,

My bank provides CSV files with categories. Here's a sample dataset;

Date,Amount,Activity,Raw description,Description,Category folder,Category
2/14/2018,-41.16,Signature purchase,MARUFUKU RAMEN,Marufuku Ramen,Food & Drink,Restaurants
2/12/2018,-41.75,Signature purchase,SQ *PAPITO HAYES,Papito Hayes,Food & Drink,Restaurants
2/11/2018,-13.8,Signature purchase,SQ *RITUAL COFFEE ROAST,Ritual Coffee Roast,Food & Drink,Coffee & Tea
2/9/2018,-35.77,Pin purchase,CHEVRON/CSI-302550/1760,Chevron,Transportation,Gas

Is there a way to include this data when creating a transaction? I noticed a recent commit that seems to address this but I'm not sure how to get it working. 

If I have a list of transactions like so;
 
2018-02-09 * "Chevron" ""
  Assets:US:Simple:Checking  -35.77 USD

2018-02-11 * "Ritual Coffee Roast" "" 
  Assets:US:Simple:Checking  -13.8 USD
 
2018-02-12 * "Papito Hayes" ""
  Assets:US:Simple:Checking  -41.75 USD
 
2018-02-14 * "Marufuku Ramen" ""
  Assets:US:Simple:Checking  -41.16 USD

Can I iterate through this list with the categorizer callable and append each category?

Omar Sandoval

unread,
Mar 1, 2018, 2:08:35 PM3/1/18
to Beancount
Hmm, nevermind. I was going about this incorrectly. Since I already know the categories I could just insert this data as a separate posting on the transaction, correct? 

Patrick Ruckstuhl

unread,
Mar 1, 2018, 3:28:58 PM3/1/18
to bean...@googlegroups.com
One way to do this is adding it as metadata. This will allow you to filter and query with it.
><https://bitbucket.org/blais/beancount/pull-requests/24/improve-ingestimporterscsv/diff>

Martin Blais

unread,
Mar 2, 2018, 12:39:39 AM3/2/18
to Beancount
That is correct, this should be "categorized' by inserting a posting automatically, e.g. an Expenses posting. You can code this up in your importer with some custom rules of your own, or, if you're using the example csv importer that comes with Beancount, you can provide it with a categorizer callable where you do this. Basically, you have to code up something, Beancount doesn't have any feature to do automatic categorization.


--
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+unsubscribe@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/46608bb3-62ea-4c60-b6c5-a1e38ab12262%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages