mathmonkey mathmonkey - 1 year ago 508
Python Question

Pandas wrapper for Bloomberg api?

I'm starting to use the python api for Bloomberg and I'm wondering if anyone has written a wrapper to convert responses from Bloomberg into pandas timeseries? pybbg is a wrapper for the old COM api which I could of course extend, but want to avoid reinventing the wheel if possible.

Answer Source

Have a look at this one

You can request Bloomberg and return a panda,Panel object with

def bdh(sec_list, fld_list, start_date,'%Y%m%d'), periodicity='DAILY',
    verbose=False, **kwargs):
    """ Sends a historical request to Bloomberg.
        sec_list: tuple or list of valid Bloomberg tickers.
        fld_list: tuple or list of valid Bloomberg fields.
        start_date: string formatted YYYYMMDD.
        end_date: string formatted YYYYMMDD (default = Today()).
        periodicity: string (default: DAILY).
        verbose: boolean to log Bloomberg response messages (default: False)
        **kwargs: any valid parameter.
    Returns a panda.Panel object.

from this lib.