Quickstart

Requirements

Python 3.10 - 3.13

We currently support the VSCode IDE and Jupyter Notebooks with our extension

Installation

In order to use the Etiq you need to install the Python package to your local environment.

Python Package

Install the etiq-copilot python package from PyPi:

pip install etiq-copilot

Usage

Use DebuggerCodeScanner to run a python file under Etiq's instrumentation. Pass the target source code to scan_code; Etiq executes the code, captures the runtime trace and observed objects, and returns a CodeScannerResult that can be used to inspect lineage outputs.

from pathlib import Path

from etiq_copilot.engine.implementations.scanner.code_scanner import DebuggerCodeScanner
from etiq_copilot.engine.implementations.scanner.scan_results import CodeScannerResult


def scan_file(scan_file_path: Path | str) -> CodeScannerResult:
    scan_file_path = Path(scan_file_path)
    original_code = scan_file_path.read_text(encoding="utf-8")
    scanner = DebuggerCodeScanner()
    return scanner.scan_code(code_str=original_code)

Example usage:

Example Target Script

The quickstart uses this iris pipeline as the target script:

Example Scan Output

After scanning the iris pipeline, inspect the scan result:

Example output:

The full lineage_json value contains the generated graph. A shortened excerpt looks like this:

The full lineage graph can be exported with create_full_lineage_graph(graph_format="json"). Generated node IDs can differ between runs.

Example Lineage Graph

Last updated