Skip to main content

Python package for retrieving data.

Project description

The Refinitiv Data Plaform Library for Python provides a set of ease-of-use functions and classes that gives your applications a uniform access to the breath and depth of financial data and services available on the Refinitiv Data Platform.

Thanks to this library the same Python code can be used to retrieve data whatever the access point your application uses to connect to the Refinitiv Data Platform (either via a direct connection, via Eikon, via the Refinitiv Workspace or even via a deployed Enterprise Platform).

The library provides several abstraction layers enabling different programming styles and technics suitable for all developers from Financial Coders to Seasoned Developers (synchronous function calls, async/await, event driven).

Some examples

Import the Refinitiv Data Platform Library

import refinitiv.dataplatform as rdp

Chose your platform access point…

…either directly to the Refinitiv Data Platform…

rdp.open_platform_session(
    '8e9bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1b035d',
    rdp.GrantPassword(
        'my_login',
        'my_password'
    )
)

…or via Eikon/Refinitiv Workspace…

rdp.open_desktop_session('8e9bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1b035d')

…or via a Deployed Platform

rdp.open_deployed_platform_session(
    '8e9bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1b035d',
    'my_deployed_platform_ip',
    'my_dacs_user_name'
)

Real-time Pricing - Get Snapshots

rdp.get_snapshot(
    universe = ['GBP=','JPY='],
    fields   = ['BID','ASK']
)
  Instruments BID ASK
0 GBP= 1.3211 1.3212
1 JPY= 108.6100 108.6200

Real-time Pricing - Get Streaming Data

streaming_prices = rdp.StreamingPrices(
    instruments = ['EUR=', 'GBP=', 'JPY=', 'CAD='],
    fields = ['DSPLY_NAME', 'BID', 'ASK'],
    on_update = lambda streaming_price, instrument_name, fields :
        print("Update received for {}: {}".format(instrument_name, fields))
)

streaming_prices.open()

Output:

<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}

Historical Pricing - Get Interday Summaries

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']
)
  BID ASK OPEN PRC HIGH 1 LOW 1 TRDPR C 1 NUM MOVES TRNOV R UNS
2019- 12-12 144.3 2 144.3 4 144.4 2 145.6 6 143.4 6 144.1 8 12631 .0 84983 47218 .7115 4
2019- 12-11 143.5 8 143.6 142.7 2 144.8 142.6 2 143.5 8 10395 .0 88154 50412 .6535 3
2019- 12-10 142.7 4 142.7 8 143.8 4 143.8 4 141.4 8 142.7 4 10311 .0 80702 85210 .4574 2
2019- 11-18 152.1 152.1 2 154.7 4 155.6 6 152.0 152.1 2 14606 .0 19322 98863 9.34
2019- 11-15 154.6 154.6 2 160.6 8 160.6 8 154.0 6 154.6 326 17035 .0 31993 01381 8.374 56

News - Get Headlines

rdp.get_news_headlines(query = 'LFR', count = 350)
versionCreated text storyId sourceCode
2019-12-12 06:51:36.518 SGX FTSE China A50 (Z9) intra day : prude nce. urn:newsml: reuters.com :20191212:n GUR92Pj4t:1 NS:GURU
2019-12-12 06:49:52.011 SSE Compo site intra day : biais hauss ier au-de s… urn:newsml: reuters.com :20191212:n GUR8gt362:1 NS:GURU
2019-12-12 06:49:33.973 Elect ion du Conse il fédér al: “repe nser la form… urn:newsml: reuters.com :20191212:n NRAafovmk:1 NS:SDASDE
2019-12-11 23:27:13.673 Le nouve au systè me en huit quest ions urn:newsml: reuters.com :20191211:n NRAafll6g:1 NS:LESECH
2019-12-11 23:27:13.653 Les clefs du royau me urn:newsml: reuters.com :20191211:n NRAaflped:1 NS:LESECH

350 rows x 4 columns

Learning materals

To learn more about the Refinitiv Data Platform Library for python just connect to the Refinitiv Developer Community. By registering and login to the Refinitiv Developer Community portal you will get free access to a number of learning materials like Quick Start guides, Tutorials, Documentation and much more.

Help and Support

If you have any questions regarding the API usage, please post them on the Refinitiv Data Platform Q&A Forum. The Refinitiv Developer Community will be very pleased to help you.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for refinitiv-dataplatform, version 1.0.0a0
Filename, size File type Python version Upload date Hashes
Filename, size refinitiv_dataplatform-1.0.0a0-py3.7.egg (77.7 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size refinitiv_dataplatform-1.0.0a0-py3-none-any.whl (78.0 kB) File type Wheel Python version 3.7 Upload date Hashes View
Filename, size refinitiv-dataplatform-1.0.0a0.tar.gz (61.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page