Metadata-Version: 2.4
Name: lseg-analytics-jupyterlab
Version: 1.5.0
Dynamic: Keywords
Summary: Provides coding assistance for the LSEG Analytics Pricing Python SDK.
Project-URL: Homepage, https://pypi.org/project/lseg-analytics-jupyterlab/
Author: LSEG.Publishers
License-Expression: LicenseRef-LSEG-Proprietary
License-File: LICENSE.txt
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Requires-Dist: black
Requires-Dist: build
Requires-Dist: cryptography
Requires-Dist: datetime
Requires-Dist: debugpy
Requires-Dist: httpx
Requires-Dist: jupyterlab<5,>=4.1.4
Requires-Dist: mypy
Requires-Dist: pkce
Requires-Dist: pyjwt
Requires-Dist: pytest
Requires-Dist: pytest-cov
Requires-Dist: pytest-jupyter
Requires-Dist: pytest-mock
Requires-Dist: python-dotenv
Requires-Dist: requests
Requires-Dist: tornado
Requires-Dist: types-requests
Requires-Dist: watchdog>=3.0.0
Provides-Extra: dev
Requires-Dist: ipykernel; extra == 'dev'
Requires-Dist: ipython; extra == 'dev'
Requires-Dist: ipywidgets; extra == 'dev'
Requires-Dist: jedi; extra == 'dev'
Requires-Dist: jupyter-client; extra == 'dev'
Requires-Dist: jupyter-core; extra == 'dev'
Requires-Dist: jupyterlab-lsp; extra == 'dev'
Requires-Dist: nbclient; extra == 'dev'
Requires-Dist: nbconvert; extra == 'dev'
Requires-Dist: nbformat; extra == 'dev'
Requires-Dist: notebook; extra == 'dev'
Requires-Dist: pydantic; extra == 'dev'
Requires-Dist: python-dateutil; extra == 'dev'
Requires-Dist: python-lsp-server; extra == 'dev'
Requires-Dist: pyyaml; extra == 'dev'
Requires-Dist: qtconsole; extra == 'dev'
Requires-Dist: traitlets; extra == 'dev'
Requires-Dist: urllib3; extra == 'dev'
Description-Content-Type: text/markdown

# LSEG Extension for JupyterLab

A JupyterLab extension with rich support for the LSEG Analytics Pricing Python SDK (PyPI package: _lseg-analytics-pricing_, hereafter referred to as “the SDK”), providing code automation features such as Intelligent Code Completion and Samples, and integrated access to the LSEG Analytics AI Assistant.

- [LSEG Extension for JupyterLab](#lseg-extension-for-jupyterlab)
  - [Introduction](#introduction)
  - [Features Overview](#features-overview)
    - [LSEG Analytics APIs](#lseg-analytics-apis)
    - [Additional SDK Integrations](#additional-sdk-integrations)
  - [Usage](#usage)
    - [Commands](#commands)
    - [Coding Assistance](#coding-assistance)
      - [Intelligent Code Completion](#intelligent-code-completion)
      - [Code Samples](#code-samples)
      - [AI Assistant](#ai-assistant)
      - [Prompt Examples](#prompt-examples) 
    - [Seamless Authentication](#seamless-authentication)
      - [Seamless Authentication - Implementation](#seamless-authentication---technical-details)
  - [Privacy Statement](#privacy-statement)
  - [License](#license)
  - [Compatibility](#compatibility)
  - [Setup Instructions](#setup-instructions)
  - [Troubleshooting](#troubleshooting)
  - [Questions, issues, feature requests, and contributions](#questions-issues-feature-requests-and-contributions)
  - [Known Issues](#known-issues)

## Introduction

The LSEG JupyterLab Extension is designed to assist coders working on financial applications. It offers a suite of predefined code templates tailored for various financial use cases and intelligent code completion features that help suggest parameter values, ensuring accuracy and efficiency in your financial coding tasks.

This extension integrates the latest LSEG Analytics APIs, providing broad support across multiple asset classes, with plans to further expand coverage in future releases.

## Features Overview

### LSEG Analytics APIs

- **Commands:**
  - Quickly access and execute LSEG Analytics functions from the command palette.
- **Coding Assistance:**
  - **Intelligent Code Completion:**
    - Enjoy real-time, context-aware code completions specifically for LSEG Analytics parameter values, reducing coding errors and boosting productivity.
  - **Code Samples:**
    - Access a library of pre-built code templates for common LSEG Analytics use cases, helping you get started quickly and efficiently.
  - **AI-Powered Code Generation:**
    - **AI Assistant:**
      - Generate Python code for FX, Calendars and IR SWAPs using natural language using the LSEG AI Assistant, with broader coverage coming in future releases.
    - **Prompt Examples:**
      - Access a library of example prompts to help guide you through basic LSEG Analytics use cases.
- **Seamless Authentication:**
  - Easily authenticate to the LSEG Analytics SDK from within JupyterLab, ensuring secure and hassle-free access.


### Additional SDK Integrations
The extension supports additional LSEG-proprietary and thrid-party analytics SDKs beyond the LSEG Analytics Pricing Python SDK, enabling broader workflows.
- **Multi-SDK Support**
  - Société Générale SDK (PyPI package: lseg-analytics-socgen) - full integration for code completion, samples and seamless authentication.
  - StarMine SDK (PyPI package: lseg-analytics-starmine) - full integration for code completion, samples and seamless authentication.
- **Configurable SDK Visibility**
  - Enable or disable individual SDKs from the extension settings. Disabling an SDK suppresses related notifications.

## Usage

### Commands

To use commands, open the Command Palette (Command+Shift+C on macOS and Ctrl+Shift+C on Windows/Linux) and type in one of the following commands:

| Command    | Description |
| -------- | ------- |
| LSEG: Sign in   | Opens window for log in details to start using the extension features.    |
| LSEG: Sign out | Logs user out     |
| LSEG: Refresh Code Completion Data    | Updates the cache of completion data which is used for parameter suggestions.    |

To see all available LSEG Analytics commands, open the Command Palette and type _LSEG:_.

### Coding Assistance

#### Intelligent Code Completion

Dynamic parameter suggestions, based on the data available to the user. To use Intelligent Code Completion:

1.  Place your cursor within a piece of code that requires a parameter.
2.  Trigger the parameter to see a list of possible values using the following method:
    - Type the name of the parameter followed by an equals sign (`=`) and run the _implicit trigger suggest_ command (`tab`).

##### Tips #####
1. Ensure the same version of the SDK installed in the working environment is installed in the JupyterLab server environment.
2. View method signatures quickly
    - Click on a method name and press `tab` to display its signature, including parameter names.
3. Trigger detailed tooltips
    - Type the method name and insert `(` to prompt a tooltip showing the method definition and docstring. This is especially useful when hover-based tooltips don’t appear reliably. 

#### Code Samples

Samples provide templates of code for key analytics functionality​. To use samples:

1. Select the LSEG icon from the left hand side bar. After logging in, expand **'LSEG Financial Analytics'** tree view and select **'Code Samples'**.
2. Once a compatible version of the SDK is installed in the JupyterLab server environment, expand the sections to browse through the available samples.
3. Open a sample as a notebook or a Python script.
4. Modify it to fit your use case.

Code samples are generated based on the SDK installed in the JupyterLab server environment.
Changing the kernel of a notebook or a Python script will not affect the content displayed on the Code Samples page.

#### AI Assistant

The interaction with the SDK is simplified with the LSEG AI Assistant.
Explore the code generation capabilities of the LSEG AI Assistant using single or multiple lines of comments for complex instructions:

1. Write your prompt as a single or multi-line comment (`#`) using natural language. 
2. Keep the cursor inside the comment block
3. Run `Alt + \` command to invoke the LSEG AI Assistant. 
4. Accept/Reject/Modify the generated code.
5. Run the code and access the LSEG Analytics API under the hood to query financial data and analytics. 

##### Tips #####
Notice that on macOS, there is a key binding conflict with the default command used to invoke the inline completer (`Option + \`).
It is recommended to configure a different key shortcut to avoid conflicts when working with the LSEG AI Assistant.

#### Prompt Examples

Prompt examples provide templates of natural language to experiment with the AI Assistant. To use the prompts:

1. Select the LSEG icon from the left hand side bar. After logging in, expand `LSEG AI Assistant` and select `Prompt Examples`.
2. Once a compatible version of the SDK is installed in the JupyterLab server environment, expand the sections to browse through the available prompt examples.
3. Open the prompt as a Python script.
4. Run `Alt + \` command on the commented line/s to receive AI-generated coding suggestions.
4. Modify the prompt to tailor it to the task you're working on.

Prompt examples are generated based on the SDK installed in the JupyterLab server environment.
Changing the kernel of a notebook or a Python script will not affect the content displayed on the Prompt Examples page.

### Seamless Authentication

The LSEG JupyterLab extension (“the extension”) makes it easier to _write_ Python code that uses the _lseg-analytics-pricing_ Python SDK. However, you need to be authenticated to be able to _execute_ your Python code that uses the SDK. 

The SDK provides several authentication mechanisms (see the SDK documentation for more information). One of these is designed to provide a seamless authentication experience when using the extension: if you are logged in to the extension, you do not need to authenticate again to execute your Python code inside JupyterLab. 

By default this is disabled. To enable it, use one of the following methods:

1. Via the extension
  - Open **Settings** from the extension's **Help** tree view.
  - Check the box labeled **'Enable Automatic Authentication'**.

2. Via the JupyterLab Settings
  - Navigate to **Settings → Settings Editor → LSEG Jupyter Settings**.
  - Check the box labeled **'Enable Automatic Authentication'**.

#### Seamless Authentication - Technical Details

When the setting is enabled, the extension starts a proxy web server that forwards calls from the SDK to the LSEG Financial Analytics backend APIs, adding the necessary authentication token. 

The behaviour of the proxy web server is as follows: 

* The proxy web server runs on http://127.0.0.1, so only the user and scripts/apps running locally can make requests to it. 
* It will only forward SDK requests to the LFA backend; it will not forward requests to unknown endpoints. 
* The extension has an output panel that shows the calls being forwarded to the LFA backend, so it is easy to see all the traffic handled by the proxy. 

There is the possibility that other local scripts/apps could try to access the proxy web server and make requests using it. If this concerns you, you can disable the proxy and use one of the other SDK authentication mechanisms. 

## Privacy Statement
Please read the [Privacy Statement](https://www.lseg.com/en/policies/privacy-statement) governing the use of this extension.

## License
See the LICENSE file installed with the extension.

## Compatibility

- LFA Python SDK Version v2.0+
- JupyterLab web-based IDE Version v4.4.x
- Operating systems: Windows, OS X, Linux

## Setup Instructions

It is strongly recommended to create and activate a dedicated `conda` or `venv` environment prior to launching the JupyterLab Web Application.

All required dependencies should be installed directly from the `Anaconda Powershell Prompt` (or an equivalent terminal outside of JupyterLab) in the JupyterLab server environment.

If installation is performed within the JupyterLab terminal, a session restart may be necessary for the changes to take effect.

### ICC Pre-Requisites

For Intelligent Code Completion (ICC) to work properly, the following tools and plugins need to be installed:

1.	Install the frontend JupyterLab extension that provides the UI for the LSP features.
```ini
pip install jupyterlab-lsp
```
2.	Install a language server for Python:
```ini
pip install python-lsp-server
```
3.	Enable LSP in JupyterLab settings:  
a.	Open JupyterLab.  
b.	Go to the menu bar and select Settings > Settings Editor > Language Servers.  
c.	Activate the Language Server and make sure to include the installed server name in the list.


## Troubleshooting

If you encounter issues while using the extension, you can try the following self-help tips to resolve them.

### Common Actions to Try

- **Log out and log in again:** Sometimes, re-authenticating can resolve issues.
- **Run cache refresh:** Use the `LSEG: Refresh Code Completion Data` command to update the cache of completion data.
- **Restart JupyterLab:** If issues persist, try clearing the LSEG cookies and restart JupyterLab.

### Sign-In / Network Issues

If you see an error when trying to sign in (e.g. _"Unable to sign in"_), it is often caused by a network configuration issue rather than a service outage. Try the following steps:

1. **Check your internet connection** — make sure you can reach external websites.
2. **Verify proxy and firewall settings** — corporate proxies or firewalls may block the LSEG authentication endpoints. Ensure that `*.lseg.com` domains are allowed.
3. **Try disabling your VPN temporarily** — some VPN configurations interfere with the authentication flow.
4. **Contact your internal IT department** — if you are behind a corporate network, your IT team can help verify that the required endpoints are reachable and that proxy exceptions are configured correctly.
5. **Contact LSEG Support** — if the issue persists after confirming your network is correctly configured, see the [Contact Support](#contact-support) section below.

### Log Output

Log output will generally come from one of two sources:
1. The extension itself
2. The SDK (`lseg-analytics-pricing`)

The JupyterLab extension adds two output windows: **LSEG Analytics** and **LSEG Analytics - SDK Auth**.

- **LSEG Analytics:** This contains general logging about the behavior of the extension itself, such as logging in, logging out, refreshing data, inserting samples, and providing code completion prompts.
- **LSEG Analytics - SDK Auth:** This contains information about the calls the extension is forwarding to the LFA web backend on behalf of the SDK.

### How to Open the Output Windows

1. Open JupyterLab.
2. Go to the menu bar and select `View → Activate Command Palette` (or press `Ctrl+Shift+C`).
3. In the command palette, use _LSEG: Show Log Console_ command for **LSEG Analytics** logs or _LSEG: Show SDK Auth Log Console_ for **LSEG Analytics - SDK Auth** logs.

### How to Increase the Logging Level
1. Open JupyterLab.
2.	Open the desired log console panel as explained in the previous section (_How to Open the Output Windows_).
3. In the Log Console panel, click on the drop down in front of the **Log Level** setting and select the desired log level from the options: error, warning, info, debug.

### How to trigger the LSEG AI Assistant
- On Windows and Linux use the default key shortcut `Alt + \`.
- On macOS there is a key binding conflict with the default shortcut (`Option + \`). Make sure to configure an alternative key shortcut to invoke the inline completer.


### Contact Support

If you need further assistance, please use the following contact information:

- **Help desk Telephone:** +1 888 333 5617
- **MyAccount Portal:** [Product and Content Support | MyAccount](https://myaccount.lseg.com)
  - Select the issue you're having
  - Choose 'LSEG Analytics API' from the dropdown

### Questions, issues, feature requests, and contributions

If you have feedback for the extension please email [analyticschannelsupport@lseg.com](mailto:analyticschannelsupport@lseg.com)

# Release notes
## Version 1.5.0 April, 2026
- **Beta SDK support:** Introduced support for Beta SDKs, which are disabled by default and can be explicitly enabled via extension settings. Beta SDKs may contain unstable features.
- **FAQ Page:** Added a new FAQ page to improve user support.
- **Minor UI improvements & Minor bug fixes:** Enhanced login error notifications, providing clearer guidance when the login service is temporarily unavailable, including how to proceed or contact support. Updated SDK walkthrough content to improve clarity and consistency across supported SDKs.

## Version 1.4.0 March, 2026
- **Multi-SDK support:** Added compatibility with the Open Risk Analytics SDK (PyPI package: lseg-analytics-openrisk), enabling integrated risk analytics workflows within the extension."
- **Minor UI improvements & Minor bug fixes:** Updated the walkthrough content and the code samples documentation for all the supported SDKs. Improved code samples and walkthroughs behaviour when support for any SDK or AI Assistant is being disabled. Fixed ICC not refreshing after SDK support is enabled post sign-in.
- **Drop support for Pricing Python SDK v1.x:** The minimum supported version of [lseg-analytics-pricing](https://pypi.org/project/lseg-analytics-pricing/) has been bumped to v2.0.0.

## Version 1.3.0 February, 2026
- **Multi-SDK support:** Added compatibility with additional analytics SDKs, including the Société Générale SDK (PyPI package: lseg-analytics-socgen), as well as the StarMine SDK (PyPI package: lseg-analytics-starmine).
- **Improved workspace experience:** New SDK management settings allow users to enable or disable individual SDKs. SDK‑specific components are loaded only when the corresponding SDK is enabled, improving performance and reducing UI clutter.

## Version 1.2.0 January, 2026
- **AI Assistant now available:** The LSEG AI Assistant can be triggered using the `Alt + \` command to receive AI-generated coding suggestions based on SDK-related prompts.
- **AI Assistant configuration:** A new user setting that allows you to enable or disable the LSEG AI Assistant can be found in the extension's Help tree view under Settings.
- **Added support for LSEG Python SDK v2:** The extension now fully supports the [lseg-analytics-pricing](https://pypi.org/project/lseg-analytics-pricing/) v2.0+, in addition to v1.0.
- **Minor UI improvements & Minor bug fixes:** Improved code samples behavior for unsupported versions of the SDK.

## Version 1.1.0 - December, 2025
- **Bug fixes and minor UI improvements:** Improved ICC for notebooks, standardized prompt UI notifications, and renamed authentication output pane.

## Version 1.0.0 - October, 2025

Version 1.0.0 of the LSEG Financial Analytics (LFA) Extension for JupyterLab. This extension brings dynamic intelligent code completion features tailored specifically for developers working with the LSEG Analytics Pricing Python SDK, empowering them to write code more efficiently and accurately.
