A step-by-step Copilot guide to set up a Data Library for Python development environment with Python and JupyterLab on Windows and macOS.
- Python 3.11 or higher installed and available on your
PATH - Git installed and configured
- Network access to PyPI (or a trusted mirror)
Run all commands in this guide from the workspace root folder.
Before running setup commands, confirm the project structure should match this layout:
/
├── .github/
│ └── copilot-instructions.md
├── .vscode/
│ └── settings.json
├── .gitignore
├── LICENSE.md
├── Project_README.md
├── README.md (for the repository)
├── images/
├── requirements.txt
├── .venv/
└── notebook/
├── ld_notebook.ipynb
└── lseg-data.config.json
Notes:
.venv/must be inside the workspace root.notebook/must contain bothld_notebook.ipynbandlseg-data.config.json.
-
Create a virtual environment named
.venvinside the workspace root:python -m venv .venv
This must create
.venvat the workspace root. -
Activate the environment:
- Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
- Windows (CMD):
.venv\Scripts\activate.bat
- macOS / Linux:
source .venv/bin/activate
- Windows (PowerShell):
-
Update pip to the latest version:
- Windows (PowerShell/CMD):
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir --upgrade pip
- macOS:
python3 -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir --upgrade pip
- Windows (PowerShell/CMD):
-
Install the required packages:
- Windows (PowerShell/CMD):
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir lseg-data jupyterlab
- macOS:
python3 -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir lseg-data jupyterlab
- Windows (PowerShell/CMD):
-
Save the installed dependencies to
requirements.txt:- Windows (PowerShell/CMD):
python -m pip freeze > requirements.txt
- macOS:
python3 -m pip freeze > requirements.txt
- Windows (PowerShell/CMD):
-
Create
.vscode/settings.jsonwith the following content:{ "git.ignoreLimitWarning": true } -
Create the following file and folder structure under the project root:
notebook/ ├── ld_notebook.ipynb └── lseg-data.config.json -
Create
lseg-data.config.jsoninsidenotebookwith the following content:{ "logs": { "level": "debug", "transports": { "console": { "enabled": false }, "file": { "enabled": false, "name": "lseg-data-lib.log" } } } }
Open notebook/ld_notebook.ipynb in JupyterLab and run the following cells in order.
-
Import the library:
import lseg.data as ld
-
Open a session (connects to LSEG Workspace):
ld.open_session()
-
Retrieve market data (BID/ASK for EUR and JPY):
ld.get_data(universe = ['/EUR=','/JPY='], fields = ['BID','ASK'])
-
Do not need to run the notebook cells. Developers can run them by themselves to verify the setup is working.
Prerequisite: The Part 3 must be completed and the notebook should have outputs saved back into
ld_notebook.ipynbbefore proceeding with these steps.
-
Add a
Project_README.mdwith# Data Library Jupyter Notebooktitle. -
Add a
.gitignorefile suitable for Python projects (e.g., from gitignore.io). -
Add the
.venv/virtual environment folder to.gitignore. -
Verify that the current branch is
main:git branch --show-current
If the command does not return
main, switch tomainbefore continuing. -
Check out a new git branch named
setup-project:git checkout -b setup-project
-
Stage all files and create a commit on
setup-project:git add . git commit -m "setup: initial project structure with notebook and dependencies"