Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

The Refinitiv Data Library for Python provides a set of ease-of-use interfaces offering your applications a uniform access to the breadth and depth of financial data and services available on the Refinitiv Data Platform.

With this library, the same Python code can be used to retrieve data whatever the access point you choose to connect your application to the Refinitiv Data Platform. It can be either via a direct connection, via Eikon, via Refinitiv Workspace, via CodeBook or even via a local Real-Time Distribution System.

The library provides several abstraction layers enabling different programming styles and technics suitable for all developers from Financial Coders to Seasoned Developers:

  • Using the Access layer is the easiest way to get Refinitiv data. The Access layer provides simple interfaces allowing you to rapidly prototype solutions within interactive environments such as Jupyter Notebooks. It has been designed for quick experimentation with our data and for Financial Coders specific needs.
  • The Content layer is the basement of the Access layer. It provides developers with interfaces suitable for more advanced use cases (synchronous function calls, async/await, event driven). The Content layer refers to logical market data objects like market data prices and quotes, fundamental & reference data, historical data, company research data and so on.
  • The Delivery layer is a low abstraction layer that defines interfaces used to interact with service agnostic delivery mechanisms of the Refinitiv Data Platform. The Delivery layer is a foundational component of the Content layer.
  • The Session layer defines interfaces allowing your application to connect to the Refinitiv Data Platform via different access points (either via a direct connection, via Eikon, via the Refinitiv Workspace, via CodeBook or even via a local Real-Time Distribution System).

Some examples...

... with the Access layer

Import the Refinitiv Data Library

import refinitiv.data as rd

Open a data session

rd.open_session()

Get pricing snapshots and fundamental data

    df = rd.get_data(
        universe=['IBM.N', 'VOD.L'], 
        fields=['BID', 'ASK', 'TR.Revenue']
    )
    print(df)
Instrument BID ASK
0 IBM.N 0.00 0.0
1 VOD.L 120.02 120.1

Get Fundamental and pricing history

    df = rd.get_history(
        universe="GOOG.O",
        fields=["BID", "ASK", "TR.Revenue"],
        interval="1Y",
        start="2015-01-01",
        end="2019-10-01",
    )
    print(df)
GOOG.O BID ASK Revenue
2015-12-31 759.06 758.99 74989000000
2016-12-31 772.94 772.12 90272000000
2017-12-31 1046.46 1046.4 110855000000
2018-12-31 1037.36 1036.98
2019-12-31 1336.94 1335.9

Close the session

rd.close_session()

... with the Content layer dedicated to advanced use cases

Import the Refinitiv Data Library

import refinitiv.data as rd

Open a data session

rd.open_session()

Fundamental And Reference data retrieval

from refinitiv.data.content import fundamental_and_reference

response = fundamental_and_reference.Definition(
    ["TRI.N", "IBM.N"],
    ["TR.Revenue", "TR.GrossProfit"]
).get_data()

print(response.data.df)
instrument date TR.Revenue TR.GrossProfit
0 TRI.N 2020-12-31T00:00:00 5984000000 5656000000
1 IBM.N 2020-12-31T00:00:00 73620000000 35574000000

Historical data retrieval

from refinitiv.data.content import historical_pricing

response = historical_pricing.summaries.Definition(
    universe='VOD.L', 
    interval=historical_pricing.Intervals.DAILY,
    fields=['BID','ASK','OPEN_PRC','HIGH_1','LOW_1','TRDPRC_1','NUM_MOVES','TRNOVR_UNS']
).get_data()

print(response.data.df)
BID ASK OPEN_PRC HIGH_1 LOW_1 TRDPRC_1 NUM_MOVES TRNOVR_UNS
2019-12-12 144.32 144.34 144.42 145.66 143.46 144.18 12631.0 8498347218.71154
2019-12-11 143.58 143.6 142.72 144.8 142.62 143.58 10395.0 8815450412.65353
2019-12-10 142.74 142.78 143.84 143.84 141.48 142.74 10311.0 8070285210.45742
... ... ... ... ... ... ... ... ...
2019-11-18 152.1 152.12 154.74 155.66 152.0 152.12 14606.0 19322988639.34
2019-11-15 154.6 154.62 160.68 160.68 154.06 154.6326 17035.0 31993013818.37456

Real-time streaming data retrieval

from refinitiv.data.content import pricing

pricing_stream = rd.content.pricing.Definition(
    universe=['EUR=', 'GBP=', 'JPY=', 'CAD='], 
    fields=['DSPLY_NAME', 'BID', 'ASK']
).get_stream()

pricing_stream.on_refresh(lambda pricing_stream, instrument_name, fields : 
        print(f"Refresh received for {instrument_name}: {fields}"))
	
pricing_stream.on_update(lambda pricing_stream, instrument_name, fields : 
        print(f"Update received for {instrument_name}: {fields}"))

pricing_stream.open()

Output:

Refresh received for EUR= : {'DSPLY_NAME': 'BARCLAYS     LON', 'BID': 1.1635, 'ASK': 1.1639}
Refresh received for GBP= : {'DSPLY_NAME': 'NEDBANK LTD  JHB', 'BID': 1.3803, 'ASK': 1.3807}
Refresh received for CAD= : {'DSPLY_NAME': 'DANSKE BANK  COP', 'BID': 1.2351, 'ASK': 1.2352}
Refresh received for JPY= : {'DSPLY_NAME': 'ASANPACIFIBK MOW', 'BID': 113.81, 'ASK': 113.83}
Update received for JPY= : {'DSPLY_NAME': 'NEDBANK LTD  JHB', 'BID': 113.81, 'ASK': 113.83}
Update received for CAD= : {'DSPLY_NAME': 'DANSKE BANK  COP', 'BID': 1.2351, 'ASK': 1.2352}
Update received for JPY= : {'DSPLY_NAME': 'ASANPACIFIBK MOW', 'BID': 113.81, 'ASK': 113.83}
Update received for EUR= : {'DSPLY_NAME': 'BARCLAYS     LON', 'BID': 1.1635, 'ASK': 1.1639}
Update received for CAD= : {'DSPLY_NAME': 'DANSKE BANK  COP', 'BID': 1.2351, 'ASK': 1.2352}

Search

from refinitiv.data.content import search

response = search.Definition("IBM").get_data()

print(response.data.df)
RIC BusinessEntity PermID DocumentTitle PI
0 ORGANISATION International Business Machines Corp, Public C... 37036
1 IBM QUOTExEQUITY 55839165994 International Business Machines Corp, Ordinary... 1097326
2 ORGANISATION Tiers Corporate Bond Backed Certificates Trust... 18062670
3 ORGANISATION SG Stuttgart Vaihingen BM-Campus 1 UG haftungs... 27968389
4 0#IBMF: QUOTExEQUITY 21481052421 Eurex International Business Machines Equity F... 48924732
5 0#IBMDF: QUOTExEQUITY 21612423771 Euronext Amsterdam IBM Dividend Future Chain C... 259118763
6 IBMFc1 QUOTExEQUITY 21481052892 Eurex International Business Machines Equity F... 49450681
7 IBMFc2 QUOTExEQUITY 21481053949 Eurex International Business Machines Equity F... 50092347
8 IBMDFc1 QUOTExEQUITY 21613372305 Euronext Amsterdam IBM Single Stock Dividend F... 260213021
9 IBMFc3 QUOTExEQUITY 21481053950 Eurex International Business Machines Equity F... 50092348

Close the session

rd.close_session()

Learn more

To learn more about the Refinitiv Data Library for Python simply log into the Refinitiv Developer Community. By registering and logging in to the Refinitiv Developer Community portal you will have free access to a number of learning materials such as 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 Q&A Forum. The Refinitiv Developer Community will be very pleased to help you.

Release files for refinitiv-data 1.0.0b9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for refinitiv-data 1.0.0b9
File Size Uploaded
refinitiv-data-1.0.0b9.tar.gz 342.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for refinitiv-data 1.0.0b9
File Interpreter ABI Platform
refinitiv_data-1.0.0b9-py3-none-any.whl Python 3 none any Details

Total release size:949.5 kB

Release files / refinitiv-data-1.0.0b9.tar.gz

Download URL refinitiv-data-1.0.0b9.tar.gz
Size 342.0 kB
Tags Source
SHA-256 checksum
How to use checksums
61c61ec05cc1b98d1c8d70233d55c1b82b24061b7b70dc4a5b517eacddb87cee
BLAKE2b-256 checksum
How to use checksums
ed1b2e91f17426cc0365ebe9f1c80e9e61279517d329878c95a863764d55510b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / refinitiv_data-1.0.0b9-py3-none-any.whl

Download URL refinitiv_data-1.0.0b9-py3-none-any.whl
Size 607.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f69a74c62e5024ada5ba2d5009621a79dc1d2e27135f0ea8e4ace8bf6345bb11
BLAKE2b-256 checksum
How to use checksums
19a4e1ed960fdad72b4f8d52db6a1abfe49a021044df9b6a2ba4c0fcd25f2fc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page