# Scripting V2 - Python (/scripting-v2)



Market Lab provides two Python workflows.

## Scripting with Jupyter Notebook [#scripting-with-jupyter-notebook]

Use JupyterLab for interactive historical research, pandas or NumPy analysis, visualization, and native Market Lab studies.

```bash
mlab notebook
```

Market Lab injects `mlab` into the notebook kernel. This workflow has no script manifest, callback hooks, simulator, or live execution.

Start with [Scripting with Jupyter Notebook](/scripting-v2/notebook).

## Plain Python Files [#plain-python-files]

Write a normal `.py` strategy and run it through Market Lab's sequential backtester, daemon, and execution runtime.

```bash
mlab script backtest strategy.py --from 2026-08-01 --to 2026-08-20
mlab script run strategy.py
```

Plain files use `on_data(ctx, history)`, retained source history, simulated or live execution, positions, PnL, and artifacts. They require no Market Lab Python package or base class.

Start with [Plain Python Files](/scripting-v2/getting-started).
