# scope_profiler.tui

*module*

Interactive Textual browser for scope-profiler HDF5 files.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L1-L1)

## scope_profiler.tui.BrowserModel

*class* · *dataclass*

```python
class BrowserModel
```

Loaded data and navigation tree for one HDF5 profile.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L69-L75)

### scope_profiler.tui.BrowserModel.file_path

*attribute* · *instance attribute*

```python
file_path: Path
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L73-L73)

### scope_profiler.tui.BrowserModel.results

*attribute* · *instance attribute*

```python
results: Any
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L74-L74)

### scope_profiler.tui.BrowserModel.root

*attribute* · *instance attribute*

```python
root: BrowserNode
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L75-L75)

## scope_profiler.tui.BrowserNode

*class* · *dataclass*

```python
class BrowserNode
```

One selectable item in the TUI navigation tree.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L59-L66)

### scope_profiler.tui.BrowserNode.children

*attribute* · *class attribute* · *instance attribute*

```python
children: list[BrowserNode] = field(default_factory=list)
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L66-L66)

### scope_profiler.tui.BrowserNode.kind

*attribute* · *instance attribute*

```python
kind: str
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L64-L64)

### scope_profiler.tui.BrowserNode.label

*attribute* · *instance attribute*

```python
label: str
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L63-L63)

### scope_profiler.tui.BrowserNode.payload

*attribute* · *class attribute* · *instance attribute*

```python
payload: dict[str, Any] = field(default_factory=dict)
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L65-L65)

## scope_profiler.tui.build_browser_model

*function*

```python
def build_browser_model(file_path: str | Path) -> BrowserModel
```

Load one HDF5 profile and build the selectable TUI navigation tree.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L186-L329)

## scope_profiler.tui.build_parser

*function*

```python
def build_parser() -> argparse.ArgumentParser
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L1609-L1620)

## scope_profiler.tui.main

*function*

```python
def main(argv: list[str] | None = None)
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L1623-L1633)

## scope_profiler.tui.node_detail_text

*function*

```python
def node_detail_text(node: BrowserNode) -> str
```

Return a plain-text detail view for a selected navigation node.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L363-L770)

## scope_profiler.tui.render_plot

*function*

```python
def render_plot(node: BrowserNode, *, filepath: str | Path | None = None, show: bool = False, settings: dict[str, Any] | None = None) -> str | None
```

Render one TUI plot node through the existing plotting functions.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L773-L874)

## scope_profiler.tui.render_plotext_text

*function*

```python
def render_plotext_text(node: BrowserNode, *, settings: dict[str, Any] | None = None, width: int = 100, height: int = 35) -> str
```

Render a Plotext chart while protecting its process-global state.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/tui.py#L958-L972)
