# scope_profiler.post_processing

*module*

CLI entry point for post-processing HDF5 profiling data.

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

## scope_profiler.post_processing.COMPANION_EXPORTS

*attribute* · *module attribute*

```python
COMPANION_EXPORTS = ('prof', 'speedscope', 'flamegraph')
```

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

## scope_profiler.post_processing.OutputTargets

*class* · *dataclass*

```python
class OutputTargets
```

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

### scope_profiler.post_processing.OutputTargets.directory

*attribute* · *instance attribute*

```python
directory: str | None
```

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

### scope_profiler.post_processing.OutputTargets.single_file

*attribute* · *instance attribute*

```python
single_file: str | None
```

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

### scope_profiler.post_processing.OutputTargets.statistics_path

*attribute* · *instance attribute*

```python
statistics_path: str | None
```

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

## scope_profiler.post_processing.build_export_parser

*function*

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

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

## scope_profiler.post_processing.build_parser

*function*

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

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

## scope_profiler.post_processing.expand_file_patterns

*function*

```python
def expand_file_patterns(file_args: list[str], parser: argparse.ArgumentParser) -> list[str]
```

Expand CLI file arguments that contain shell-style wildcard patterns.

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

## scope_profiler.post_processing.export_main

*function*

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

Export HDF5 profiling data without rendering plot images.

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

## scope_profiler.post_processing.main

*function*

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

Render one plot kind or plot preset from HDF5 profiling data.

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

## scope_profiler.post_processing.parse_ranks

*function*

```python
def parse_ranks(spec: str, verbose: bool = False) -> list[int]
```

Parse a rank specification string into a list of integers.

Supports comma-separated values and ranges (e.g., '1-3,5').

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

## scope_profiler.post_processing.parse_region_groups

*function*

```python
def parse_region_groups(specs: list[str] | None, parser: argparse.ArgumentParser) -> dict[str, list[str]] | None
```

Parse ``--combine-regions`` specs into a ``{name: [patterns]}`` dict.

Each spec has the form ``NAME=PATTERN1,PATTERN2``. Repeating the same
NAME across specs is not supported - pass every pattern for a group in
one spec instead.

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