ibparser: a command line reporting tool for your IB CSV files

Discussion in 'Interactive Brokers' started by belugame, Mar 14, 2021.

  1. belugame

    belugame

    Hey everyone,

    I'm working since a while on parsing the Interactive Brokers CSVs files and have made the project open-source. It aims to have a fast, human-readable and convenient access to the data (any number of CSVs combined). My most common use cases are like:
    • give me a list of transactions in the past x days
    • give me a list of transactions or dividends of symbol X (and Y, Z)
    • show me a graph of realized gains for a symbol
    What is a CSV file?
    A CSV (comma-separated-values) is a list of values that can easily be read by computers, less so by humans. IB creates such files for your account to list transactions, dividends, money movements and more.

    Screenshots:

    [​IMG]
    [​IMG]

    One can set up IB to send out these CSVs daily to an email or FTP account, so new transactions will show up after a day. And you can create CSVs for up to a full year to add any data since your account creation.

    Output can be filtered by only sell or only buy transactions, by date like "past 3 weeks" or "year-to-date" and can convert all money amounts to a desired currency. It will try to identify the yahoo ticker symbol based on the metadata that IB provides and fetch the current price and calculate loss/gain in relative and absolute amounts.

    If you enjoy working with a command line interpreter or analyzing past transactions this could be interesting for you too. It's still in early development and the list of working exchanges is limited to what I have in my real+paper account, so it may not work for you out of the box.

    The project with more instructions can be found here: https://github.com/belugame/ibparser

    Feedback or contributions are welcome :)

    Disclaimer: I don't have a finance background so no guarantee that any numbers are correct.
     
  2. 2rosy

    2rosy

    cool, you can get this data via flex queries and store it. pandas is useful.
    df= read_csv()
    df.plot()
     
  3. belugame

    belugame

    Thank you 2rosy, I was not aware of these flex queries access point of IB. From the examples I found they will only give you XML and no CSV though, is it?
     
  4. Butterfly

    Butterfly

    parser of CSV files, is that a joke???

    parser are for unstructured data files, not structured like tab and CSV

    seems like a lot of effort for a github project when you can parse the whole thing with one command from PANDA or use PHP internal CSV reader

    your output looks nice though, but I can process any CSV and TAB files from IB with a simple Python script and import them into a real database for all kind of calculations
     
  5. belugame

    belugame

    Care to show how you parse a collection of IB csv files in one command including catering for splits and the various formats of columns for transactions?
     
  6. Butterfly

    Butterfly

    have you ever had access to actual IB accounts? the FLEX queries and the standard reports can be customized and delimited with anything you choose etc... different time frequency for certain data means different type of reports etc...

    sounds like you are a newbie and needed a project for github :)