No refinitiv.data attribute set_app_key

Hi,
The below instructions were given to me by one of your representatives. They said I should ask here for a resolution.
I’m on a Windows machine running Python 3.11 via Visual Studio Code. I have installed refinitiv-data and eikon via pip. Eikon is running in the background. Scripts are running in Codebook without a problem.
I have restarted both apps and the machine. Same error. Please advise on how to proceed. Thank you
Sample script:
---------------------------------------------------------------------------
import refinitiv.data as rd
import eikon as ek
import pandas as pd
rd.set_app_key('key……..')
rd.open_session()
rd.get_data(['LSEG.L', 'VOD.L'])
---------------------------------------------------------------------------
Error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
c:\Users\acc_name\Coding\test\test1.py in line 5
2 import eikon as ek
3 import pandas as pd
----> 5 rd.set_app_key('key……..')
7 rd.open_session()
9 rd.get_data(['LSEG.L', 'VOD.L'])
File c:\Users\acc_name\AppData\Local\Programs\Python\Python311\Lib\site-packages\refinitiv\data\_tools\_lazy_loader.py:81, in attach.<locals>.__getattr__(name)
79 return attr
80 else:
---> 81 raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No refinitiv.data attribute set_app_key
---------------------------------------------------------------------------
Best Answer
-
Thank you for reaching out to us.
The RD library doesn't have the set_app_key method.
Typically, you can use the RD library (import refinitiv.data as rd) or Eikon Data API (import eikon as ek), but not both because both libraries provide the similar functionalities.
I suggest to use only the RD library (import refinitiv.data as rd).
You can refer to the RD library examples on GitHub.
1. Download and unzip the examples
2. Modify the Configuration/refinitiv-data.config.json file by setting the default session to "desktop.workspace" and setting the application key
3. Run some examples
0
Answers
-
Thanks. I just did this. I put the config file in the same directory as the script.
Ran the following code and it generated an empty Dataframe:
----------------------------------------------------------
import refinitiv.data as rd
import pandas as pd
rd.open_session()
rd.get_data(['LSEG.L', 'VOD.L'])
0 -
You can enable the debug log level to verify what the problem is.
config = rd.get_config()
config.set_param("logs.transports.console.enabled", True)
config.set_param("logs.level", "debug")
rd.open_session()0 -
Code and log below. Log displays the correct app_key but have removed from below:
--------------------------------
import refinitiv.data as rd
import pandas as pd
rd.open_session()
rd.get_data(['LSEG.L', 'VOD.L'])
config = rd.get_config()
config.set_param("logs.transports.console.enabled", True)
config.set_param("logs.level", "debug")
rd.open_session()
--------------------------------
--------------------------------
[2023-10-19T14:06:28.339888+08:00] - [DEBUG] - [sessions.desktop.workspace.16] - [24980] | MainThread
DesktopSession created with following parameters: app_key="KEY_REDACT", name="workspace" base_url="http://localhost:9000" platform_path_rdp="/api/rdp" platform_path_udf="/api/udf" handshake_url="/api/handshake"
[2023-10-19T14:06:28.340885+08:00] - [DEBUG] - [sessions.desktop.workspace.16] - [24980] | MainThread
+ Session created: <refinitiv.data.session.Definition object at 0x24b5c3f8490 {name='workspace'}>
[2023-10-19T14:06:28.498467+08:00] - [DEBUG] - [sessions.desktop.workspace.17] - [24980] | MainThread
DesktopSession created with following parameters: app_key="KEY_REDACT", name="workspace" base_url="http://localhost:9000" platform_path_rdp="/api/rdp" platform_path_udf="/api/udf" handshake_url="/api/handshake"
[2023-10-19T14:06:28.498467+08:00] - [DEBUG] - [sessions.desktop.workspace.17] - [24980] | MainThread
+ Session created: <refinitiv.data.session.Definition object at 0x24b5c387850 {name='workspace'}>
--------------------------------
0 -
The code should be like this:
import refinitiv.data as rd
import pandas as pd
config = rd.get_config()
config.set_param("logs.transports.console.enabled", True)
config.set_param("logs.level", "debug")
rd.open_session()
rd.get_data(['LSEG.L', 'VOD.L'])You may not have permission to access those RICs. Please try the delayed RICs.
rd.get_data(['/LSEG.L', '/VOD.L'])
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛