用于检索数据的Python包。
refinitiv-dataplatform的Python项目详细描述
用于Python的Refinitiv数据平台库提供了一组易用性 为应用程序提供对 Refinitiv提供的金融数据和服务的深度和广度 数据平台。在
多亏了这个库,可以使用相同的Python代码来检索数据 无论应用程序使用什么接入点连接到Refinitiv 数据平台(通过直接连接、Eikon和Refinitiv 工作区,甚至通过部署的企业平台)。在
该库提供了几个抽象层,支持不同的 编程风格和技术适合所有来自金融业的开发人员 程序员给经验丰富的开发人员(同步函数调用,异步/等待, 事件驱动)。在
一些例子
导入Refinitiv数据平台库
importrefinitiv.dataplatformasrdp
选择您的平台接入点
…或者直接到Refinitiv数据平台…
^{pr2}$…或通过Eikon/Refinitiv Workspace…
rdp.open_desktop_session('8e9bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1b035d')
…或通过部署的平台
rdp.open_deployed_platform_session('8e9bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1b035d','my_deployed_platform_ip','my_dacs_user_name')
实时定价-获取快照
rdp.get_snapshot(universe=['GBP=','JPY='],fields=['BID','ASK'])
Instruments | BID | ASK | |
---|---|---|---|
0 | GBP= | 1.3211 | 1.3212 |
1 | JPY= | 108.6100 | 108.6200 |
实时定价-获取流数据
streaming_prices=rdp.StreamingPrices(instruments=['EUR=','GBP=','JPY=','CAD='],fields=['DSPLY_NAME','BID','ASK'],on_update=lambdastreaming_price,instrument_name,fields:print("Update received for {}: {}".format(instrument_name,fields)))streaming_prices.open()
输出:
<StreamState.Open: 3>
Update received for JPY=: {'DSPLY_NAME': 'BARCLAYS LON', 'BID': 109.59, 'ASK': 109.62}
Update received for GBP=: {'DSPLY_NAME': 'ASANPACIFIBK MOW', 'BID': 1.341, 'ASK': 1.3411}
Update received for EUR=: {'DSPLY_NAME': 'UBS ZUR', 'BID': 1.117, 'ASK': 1.1174}
Update received for CAD=: {'DSPLY_NAME': 'HSBC LON', 'BID': 1.3165, 'ASK': 1.3167}
Update received for JPY=: {'DSPLY_NAME': 'ASANPACIFIBK MOW', 'BID': 109.59, 'ASK': 109.61}
Update received for GBP=: {'DSPLY_NAME': 'INTERPROMBAN MOW', 'BID': 1.341, 'ASK': 1.3412}
Update received for EUR=: {'DSPLY_NAME': 'RBS LON', 'BID': 1.117, 'ASK': 1.1174}
Update received for CAD=: {'DSPLY_NAME': 'CIBC TOR', 'BID': 1.316, 'ASK': 1.3164}
Update received for JPY=: {'DSPLY_NAME': 'BARCLAYS LON', 'BID': 109.59, 'ASK': 109.62}
Update received for GBP=: {'DSPLY_NAME': 'INTERPROMBAN MOW', 'BID': 1.341, 'ASK': 1.3413}
Update received for EUR=: {'DSPLY_NAME': 'BARCLAYS LON', 'BID': 1.117, 'ASK': 1.1174}
Update received for CAD=: {'DSPLY_NAME': 'CIBC TOR', 'BID': 1.316, 'ASK': 1.3164}
Update received for JPY=: {'DSPLY_NAME': 'ASANPACIFIBK MOW', 'BID': 109.59, 'ASK': 109.61}
Update received for GBP=: {'DSPLY_NAME': 'BARCLAYS LON', 'BID': 1.341, 'ASK': 1.3414}
历史定价-获取日间摘要
rdp.get_historical_price_summaries(universe='VOD.L',interval=rdp.Intervals.DAILY,fields=['BID','ASK','OPEN_PRC','HIGH_1','LOW_1','TRDPRC_1','NUM_MOVES','TRNOVR_UNS'])^{tb2}$
新闻-获取头条新闻
rdp.get_news_headlines(query='LFR',count=350)
versionCreated | text | storyId | sourceCode |
---|---|---|---|
2019-12-12 06:51:36.518 | SGX FTSE China A50 (Z9) intraday : prudence. | urn:newsml:reuters.com:20191212:nGUR92Pj4t:1 | NS:GURU |
2019-12-12 06:49:52.011 | SSE Composite intraday : biais haussier au-des... | urn:newsml:reuters.com:20191212:nGUR8gt362:1 | NS:GURU |
2019-12-12 06:49:33.973 | Election du Conseil fédéral: "repenser la form... | urn:newsml:reuters.com:20191212:nNRAafovmk:1 | NS:SDASDE |
... | ... | ... | ... |
2019-12-11 23:27:13.673 | Le nouveau système en huit questions | urn:newsml:reuters.com:20191211:nNRAafll6g:1 | NS:LESECH |
2019-12-11 23:27:13.653 | Les clefs du royaume | urn:newsml:reuters.com:20191211:nNRAaflped:1 | NS:LESECH |
350行x 4列
学习材料
要了解更多关于prefinitiv Data Platform Library for python 连接Refinitiv开发者社区。通过 registering和 login到表面 开发者社区门户,你可以免费访问 学习材料如 Quick Start guides,Tutorials,Documentation 还有更多。在
帮助和支持
如果您对API的使用有任何疑问,请在 Refinitiv Data Platform Q&A Forum。 Refinitiv开发者社区将非常乐意为您提供帮助。在
- 项目
标签: