LSEG Data Library for Python

Configuration file

For ease of use, you can set various initialisation parameters for the session layer and whole LSEG Data Library in the lseg-data.config.json configuration file - as detailed in the section below.

Typically, you can place this file in the same folder as your Notebook or Python script. You can also place the file in your home folder, or in an alternative folder, and specify the folder path using the RD_LIB_CONFIG_PATH environment variable.

Using configuration file

Using the LSEG Data library config file allows you to specify various parameters, such as:

  • Default session
  • Credentials
  • Connectivity parameters
  • Logging related:
    • Enable/Disable console or file logging
    • Log level
    • Log file name

Using the lseg-data.config.json file, where possible, provides the simplest approach to creating and opening sessions.
For example, assuming you have lseg-data.config.json in the Configuration directory with the credentials and the specified default session, you can create and open the default session using the following:

ld.open_session()

The statement above will look for an entry, such as:

"sessions": {
    "default": "desktop.workspace",
    ...
}

It will then use the parameters that are defined in the configuration section ("desktop.workspace", in this example) to create and open a desktop session.

Note: If you do not have any configuration file, by default rd.open_session() creates and opens a desktop session. This session will try to connect to the LSEG Workspace (or Eikon) desktop application that is running on the same machine as your Python script.

Open a specific configured session

If you have multiple session configurations specified in the JSON configuration file, you can open a specific one by name. For example, the following code opens a session based on the parameters specified in the "platform.rdp" section of the JSON configuration file:

ld.open_session(name='platform.rdp')
277 words (1:27 mins)