I am looking to build a function that downloads data from Bloomberg for a list of securities. After doing some research, I decided to use TIA and seems to be working fine for Price Data.
However, when I use it for non price data, for example HB INDUSTRY SECTOR ALLOCATION
for a given fund, say EFA US Equities
. Is there an easy and a clean way to do this?
If I use this as below, it returns to me in a weird format that I don't understand. I suppose it's due to non numeric values not being wrapped in Pandas (which is what TIA does).
from tia.bbg import LocalTerminal
resp = LocalTerminal.get_reference_data('EFA US EQUITY', ['HB_INDUSTRY_SECTOR_ALLOCATION'])
sector = resp.as_frame()
Is there an easy way to do this and download any Bloomberg data in Python?
It gives a nested dictionnary. you can use
which will give you a frame with your data.