Fetching quarterly results¶
Show code cell content
import refinitiv.data as rd
rd.open_session()
/home/runner/.local/share/virtualenvs/refinitiv-data-python-cookbook-I-HIyNf4/lib/python3.10/site-packages/refinitiv/data/_access_layer/session.py:71:FutureWarning:
You open a platform session using the default value of the signon_control parameter (signon_control=True).
In future library version v2.0, this default will be changed to False.
If you want to keep the same behavior as today, you will need to set the signon_control parameter to True either in the library configuration file
({'sessions':{'platform':{'your_session_name':{'signon_control':true}}}}) or in your code where you create the Platform Session.
These alternative options are already supported in the current version of the library.
[Error 400] - {'error': 'access_denied', 'error_description': 'Account locked out due to provide incorrect password.'}
<refinitiv.data.session.Definition object at 0x7fa6c85cd510 {name='rdp'}>
You can use the Refinitiv Data Library for Python to retrieve quarterly results that company’s post each earnings season.
To do so, pass the company’s Refinitiv Instrument Code to the get_data
submodule. In addition to the code, you must provide custom parameters that specify the metric, time interval and number of periods to retrieve.
Revenue¶
The same logic can be used to query revenue, which is provided by the “TR.RevenueActValue” field.
expression = "TR.RevenueActValue(SDate=0,EDate=-8,Period=FQ0,Frq=FQ)"
rd.get_data(
"TRI.TO",
fields=[
f"{expression}.Date",
f"{expression}.periodenddate",
expression,
],
)
Show code cell content
rd.close_session()