|
| 1 | +# Data Library - Project Setup Guide |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +A step-by-step Copilot guide to set up a [Data Library for Python](https://developers.lseg.com/en/api-catalog/lseg-data-platform/lseg-data-library-for-python) development environment with Python and JupyterLab on Windows and macOS. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- Python 3.11 or higher installed and available on your `PATH` |
| 10 | +- Git installed and configured |
| 11 | +- Network access to PyPI (or a trusted mirror) |
| 12 | + |
| 13 | +## Working Directory (Important) |
| 14 | + |
| 15 | +Run all commands in this guide from the **workspace root** folder. |
| 16 | + |
| 17 | +## Expected Project Layout |
| 18 | + |
| 19 | +Before running setup commands, confirm the project structure should match this layout: |
| 20 | + |
| 21 | +```text |
| 22 | +/ |
| 23 | +├── .github/ |
| 24 | +│ └── copilot-instructions.md |
| 25 | +├── .gitignore |
| 26 | +├── images/ |
| 27 | +├── LICENSE.md |
| 28 | +├── README.md |
| 29 | +├── requirements.txt |
| 30 | +├── .venv/ |
| 31 | +└── notebook/ |
| 32 | + ├── ld_notebook_async.ipynb |
| 33 | + ├── .env |
| 34 | + ├── .env.example |
| 35 | + └── lseg-data.config.json |
| 36 | +``` |
| 37 | + |
| 38 | +Notes: |
| 39 | +- `.venv/` must be inside the workspace root. |
| 40 | +- `notebook/` must contain both `ld_notebook_async.ipynb` and `lseg-data.config.json`. |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## Part 1: Check the minimum project file requirements |
| 45 | + |
| 46 | +1. Check if the following files and folders are present in the workspace root and have content: |
| 47 | + |
| 48 | + - `README.md` |
| 49 | + - `LICENSE.md` |
| 50 | + - `.gitignore` (must include `.venv/` and `notebook/.env` entries) |
| 51 | + - `images/` (folder must exist) |
| 52 | + - `notebook/` (folder must exist) |
| 53 | + - `requirements.txt` (must exist) |
| 54 | + - `notebook/.env.example` (must exist) |
| 55 | + - `notebook/lseg-data.config.json` (must exist) |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Part 2: Set Up the Python Virtual Environment |
| 60 | + |
| 61 | +> **Prerequisite:** The Part 1 must be completed |
| 62 | +
|
| 63 | +1. Create a virtual environment named `.venv` inside the workspace root (same command on all platforms): |
| 64 | + |
| 65 | + ```bash |
| 66 | + python -m venv .venv |
| 67 | + ``` |
| 68 | + |
| 69 | + This must create `.venv` at the workspace root. |
| 70 | + |
| 71 | +2. Activate the environment: |
| 72 | + |
| 73 | + - **Windows (PowerShell):** |
| 74 | + ```powershell |
| 75 | + .\.venv\Scripts\Activate.ps1 |
| 76 | + ``` |
| 77 | + - **Windows (CMD):** |
| 78 | + ```cmd |
| 79 | + .venv\Scripts\activate.bat |
| 80 | + ``` |
| 81 | + - **macOS / Linux:** |
| 82 | + ```bash |
| 83 | + source .venv/bin/activate |
| 84 | + ``` |
| 85 | +
|
| 86 | +3. Update pip to the latest version: |
| 87 | +
|
| 88 | + - **Windows (PowerShell/CMD):** |
| 89 | + ```powershell |
| 90 | + python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir --upgrade pip |
| 91 | + ``` |
| 92 | + - **macOS:** |
| 93 | + ```bash |
| 94 | + python3 -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir --upgrade pip |
| 95 | + ``` |
| 96 | +
|
| 97 | +4. Install the required packages: |
| 98 | +
|
| 99 | + - **Windows (PowerShell/CMD):** |
| 100 | + ```powershell |
| 101 | + python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir -r requirements.txt |
| 102 | + ``` |
| 103 | + - **macOS:** |
| 104 | + ```bash |
| 105 | + python3 -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --no-cache-dir -r requirements.txt |
| 106 | + ``` |
| 107 | +
|
| 108 | +5. Verify the installation succeeded: |
| 109 | +
|
| 110 | + - **Windows (PowerShell/CMD):** |
| 111 | + ```powershell |
| 112 | + python -c "import lseg.data; print('lseg-data installed successfully')" |
| 113 | + ``` |
| 114 | + - **macOS:** |
| 115 | + ```bash |
| 116 | + python3 -c "import lseg.data; print('lseg-data installed successfully')" |
| 117 | + ``` |
| 118 | +--- |
0 commit comments