Interactive Brokers - import advice?

321 views
Skip to first unread message

Joe King

unread,
Feb 5, 2018, 9:20:55 AM2/5/18
to Beancount
Does anyone have any experience with importing Interactive Brokers reports?  There's a choice of csv and the similar "flex query" xml, and ofx.  Is either preferable?  Has anyone written any importers for them?

Thanks,
Joe

Martin Blais

unread,
Feb 6, 2018, 12:54:38 AM2/6/18
to Beancount
If it's in CSV format it should be possible to configure the CSV importer included in beancount.ingest.importers.csv
I haven't used IB, I'd be surprised if nobody else did here though.

--
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/304baa93-ccfe-46b5-b4b8-86d937e6e25a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe King

unread,
Feb 6, 2018, 5:00:56 AM2/6/18
to Beancount
The csv seems to be a flattened version of the xml, or equivalently a bunch of different csv reports concatenated into one.  Still, not insurmountable, but was rather hoping someone might already have tackled it.


On Tuesday, 6 February 2018 13:54:38 UTC+8, Martin Blais wrote:
If it's in CSV format it should be possible to configure the CSV importer included in beancount.ingest.importers.csv
I haven't used IB, I'd be surprised if nobody else did here though.
On Mon, Feb 5, 2018 at 9:20 AM, Joe King <joe...@gmail.com> wrote:
Does anyone have any experience with importing Interactive Brokers reports?  There's a choice of csv and the similar "flex query" xml, and ofx.  Is either preferable?  Has anyone written any importers for them?

Thanks,
Joe

--
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.

Paulo Matos

unread,
Jan 23, 2019, 2:03:21 AM1/23/19
to bean...@googlegroups.com, Joe King


On 06/02/2018 11:00, Joe King wrote:
> The csv seems to be a flattened version of the xml, or equivalently a
> bunch of different csv reports concatenated into one.  Still, not
> insurmountable, but was rather hoping someone might already have tackled it.
>

Hi Joe,

I am using IB but I can't see where you are downloading the CSV reports.
Also, have you wrote anything to get them imported to beancount?

--
Paulo Matos

Joe King

unread,
Jan 23, 2019, 5:30:34 AM1/23/19
to Beancount
Reports > Statements then change format to csv.

In the end I wrote some code in R to parse the xml (I don't know python sadly).  I generate a 'previous week' xml once a week (to avoid overlapping time periods), the script outputs a text file which I manually append to my beancount file.  Run the 'setup' and 'output' code, the stuff in 'investigate' was me playing around trying to figure out what I needed to extract.

Was going to clean it up and put it on github but lost the momentum...  It's not perfect, but works for my needs, hope it helps!
Beancount-IB.zip

Martin Blais

unread,
Jan 29, 2019, 9:38:46 PM1/29/19
to Beancount
On Wed, Jan 23, 2019 at 5:30 AM Joe King <joe...@gmail.com> wrote:
Reports > Statements then change format to csv.

In the end I wrote some code in R to parse the xml (I don't know python sadly).

That requires a lot of courage.

 
  I generate a 'previous week' xml once a week (to avoid overlapping time periods),

That requires a lot of discipline.

 
the script outputs a text file which I manually append to my beancount file.  Run the 'setup' and 'output' code, the stuff in 'investigate' was me playing around trying to figure out what I needed to extract.

Was going to clean it up and put it on github but lost the momentum...  It's not perfect, but works for my needs, hope it helps!

--
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.
Reply all
Reply to author
Forward
0 new messages