Skip to content

LSEG-API-Samples/Article.DataLibrary.Python.CrossEconomicData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retrieve Cross Economic Data using Data Library for Python

  • Last update: April 2025
  • Environment: Windows
  • Compiler: Python
  • Prerequisite: LSEG Workspace desktop application with access to Data Library.

Overview

Due to this DA (Data Notification) DN092084-Decommission of ECON chains from Workspace effective on 30 September 2017, we are moving away from the previous Country Economic Indicator chains to apps that are fully customizable and leverage on the depth of content that is available. For example, these chains have a fixed view and users cannot change which columns they want to see or don’t want to see. Whereas the Economic Monitor app on Workspace allows full customization to view the calendar of releases. For example, users can customize the following:

  • List of countries
  • Range of dates for events
  • View only a customized set of indicators
  • Alter the position of column
  • Add and remove the columns

To access Economic Monitor app, Type EM in the Workspace Search box and hit Enter, to launch the app.

Figure-1

Figure-1

Introduction to the Data Library for Python

The Data Library for Python provides a set of ease-of-use interfaces offering coders uniform access to the breadth and depth of financial data and services available on the Workspace, RDP, and Real-Time Platforms. The API is designed to provide consistent access through multiple access channels and target both Professional Developers and Financial Coders. Developers can choose to access content from the desktop, through their deployed streaming services, or directly to the cloud. With the Data Library, the same Python code can be used to retrieve data regardless of which access point you choose to connect to the platform.

Figure-1

The Data Library are available in the following programming languages:

For more deep detail regarding the Data Library for Python, please refer to the following articles and tutorials:

Disclaimer

This project is based on Data Library Python versions 2.1.1 using the Desktop Session only.

Prerequisite

This example requires the following dependencies softwares and libraries.

  1. LSEG Workspace desktop application with access to Data Library for Python.
  2. Python (Ananconda or MiniConda distribution/package manager also compatible).
  3. Jupyter Lab application.

Note:

  • This Project has been qualified with Python version 3.11.5
  • If you are not familiar with Jupyter Lab application, the following tutorial created by DataCamp may help you.

Data Library with Desktop Session Set Up

Please follow a step by step guide to setup your library and App-Key in "Desktop - Eikon or LSEG Workspace" of LSEG Data Library for Python Quick Start page .

How to run this example

Please note that the Workspace desktop application integrates a Data API proxy that acts as an interface between the Python library and the Workspace Platform. For this reason, the Workspace application must be running when you use the Data library.

The first step is unzip or download the example project folder into a directory of your choice, then choose how to run application based on your environment below.

Running the Notebook example.

  1. Open a Command Prompt and go to project's folder

  2. Run the following command in a Command Prompt to create a Python virtual environment named econ for the project.

    $>python -m venv econ
  3. Once the environment is created, activate a virtual environment named econ with this command in a Command Prompt

    $>econ\Scripts\activate
  4. Go to project's notebook folder and update a contain in lseg-data.config.json file with the your App-Key

    {
        "logs": {
            "level": "debug",
            "transports": {
                "console": {
                    "enabled": false
                },
                "file": {
                    "enabled": false,
                    "name": "lseg-data-lib.log"
                }
            }
        },
        "sessions": {
            "default": "desktop.workspace",
            "desktop": {
                "workspace": {
                    "app-key": "YOUR APP KEY GOES HERE!"
                }
            }
        }
    }
  5. Run the following command in a Command Prompt to install the project dependencies

    $>(econ) pip install -r requirements.txt
  6. In the current Command Prompt, go to project's notebook folder. Run the following command to start Jupyter Lab in the notebook folder.

    $>(econ)>notebook>jupyter lab
  7. Open ld_cross-economic-indicators.ipynb Notebook document, then follow through each notebook cell.

    Figure-4

Note: If you are using AnaConda/MiniConda, please refer to this Conda - Managing environments document for more detail about how create and activate environment with Conda.

References

You can find more detail regarding the Data Library and related technologies for this Notebook from the following resources:

For any question related to this example or Data Library, please use the Developers Community Q&A Forum.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •