How do I store data from the Bloomberg API into a Pandas dataframe?

I use tia (https://github.com/bpsmith/tia/blob/master/examples/datamgr.ipynb)

It already downloads data as a panda dataframe from bloomberg.
You can download history for multiple tickers in one single call and even download some bloombergs reference data (Central Bank date meetings, holidays for a certain country, etc)

And you just install it with pip.
This link is full of examples but to download historical data is as easy as:

import pandas as pd
import tia.bbg.datamgr as dm

mgr = dm.BbgDataManager()
sids = mgr['MSFT US EQUITY', 'IBM US EQUITY', 'CSCO US EQUITY']
df = sids.get_historical('PX_LAST', '1/1/2014', '11/12/2014')

and df is a pandas dataframe.

Hope it helps

Leave a Comment