Metadata-Version: 2.4
Name: polars-source-utils
Version: 0.6.0
Requires-Dist: polars==1.44.1
Summary: Utilities for inspecting and rewriting Polars serialized plan source paths
Requires-Python: >=3.14
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# polars-source-utils

Utilities for inspecting and rewriting source paths inside binary Polars
`LazyFrame` plans.

```python
from polars_source_utils import list_source_paths, replace_source_paths

paths = list_source_paths("data/node.plbin")
changed = replace_source_paths("data/node.plbin", {paths[0]: "/new/data.parquet"})
```

The functions are designed for workspace persistence flows that need to rebase
absolute scan paths after moving a workspace folder. They do not collect the
plan or rewrite underlying data files.

Plan traversal is exhaustive over Polars 1.44.1. Rewrites are serialized to a
same-directory temporary file and atomically replace the original only after a
successful flush and sync, so a serialization or persistence failure preserves
the existing plan.

See the [package architecture](../docs/architecture/packages/polars-source-utils.md)
for the ownership boundary.

## Development

```bash
uv sync
uv run maturin develop --release --locked
uv run pytest -q
```

