csingley / ibflex

Python parser for Interactive Brokers Flex XML statements
MIT License
85 stars 42 forks source link

[feature request] Support CSV output format #47

Closed zhaoy99 closed 2 years ago

zhaoy99 commented 2 years ago

I was able to download/parse the Activity Flex Query outputs, as XML. When I set up my Activity Flex Query output format to CSV, the code throws a BadResponseError. Can you support CSV output format? Thanks for working on this!

csingley commented 2 years ago

Why would I want to process CSV? That's for spreadsheets (i.e. human accountants), not machine processing.

You know you can define both CSV queries and XML queries, right? So you can download CSV format if you want to import that into a spreadsheet or what have you, and then you can also download XML format if you want to import it into Python. You can even automate both these downloads so it's very little trouble to get both CSV and XML.

Or you could write your own script to ingest XML and export CSV in whatever specific format would be most suitable to hand off to the back office or custodians or CPAs or your regulator or what have you. Why just take whatever lousy CSV format IBKR is handing out?