彭博 api 的 Pandas 包装器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18520416/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 21:07:13  来源:igfitidea点击:

Pandas wrapper for Bloomberg api?

pythonpandasbloomberg

提问by mathmonkey

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

我开始为 Bloomberg使用python api,我想知道是否有人编写了一个包装器来将来自 Bloomberg 的响应转换为 Pandas 时间序列? pybbg是旧 COM api 的包装器,我当然可以扩展它,但希望尽可能避免重新发明轮子。

采纳答案by kiriloff

Have a look at this one

看看这个

https://code.google.com/p/pyalma/source/browse/trunk/InfoProviders/Bloomberg.py

https://code.google.com/p/pyalma/source/browse/trunk/InfoProviders/Bloomberg.py

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

您可以请求 Bloomberg 并返回一个 panda,Panel 对象

def bdh(sec_list, fld_list, start_date,
    end_date=dt.date.today().strftime('%Y%m%d'), periodicity='DAILY',
    verbose=False, **kwargs):
    """ Sends a historical request to Bloomberg.
    Parameters:
        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.

从这个库。

回答by kyuni22

Have a look at this one too

也看看这个

https://github.com/kyuni22/pybbg

https://github.com/kyuni22/pybbg

I made this for me since above does not work for me. It is kind of modified version of above. So if you need something work without modification, here it is.

我为我做了这个,因为上面对我不起作用。它是上面的一种修改版本。因此,如果您需要无需修改即可工作的内容,这里是。

回答by thecircus

For future reference, the package mentioned in the question has moved and is now incorporated into Tools for Analysis and Integration. It uses Pandas and has a lot of other features that may be of interest.

为了将来参考,问题中提到的包已移动,现在已合并到Tools for Analysis and Integration 中。它使用 Pandas 并具有许多可能令人感兴趣的其他功能。

回答by mgilbert

This is an alternative library https://github.com/matthewgilbert/pdblp. It was inspired by pybbg but has several different features.

这是一个替代库https://github.com/matthewgilbert/pdblp。它的灵感来自 pybbg,但有几个不同的功能。

Disclaimer: I am the author

免责声明:我是作者