Metadata-Version: 2.4
Name: pastr
Version: 0.1.0
Summary: Prompt loading with recursive includes and code substitution.
Author-email: James Stankowicz <jj.stankowicz@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/jjstankowicz/pastr
Project-URL: Repository, https://github.com/jjstankowicz/pastr
Project-URL: Issues, https://github.com/jjstankowicz/pastr/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# pastr

Prompt loading utilities.

## Install

After the first PyPI release:

```bash
uv add pastr
```

Fallback before a package release is published:

```bash
uv add "pastr @ git+https://github.com/jjstankowicz/pastr.git@v0.1.0"
```

Release steps are documented in `docs/pypi-release.md`.

## Quick Start

```python
from pathlib import Path

from pastr import load_prompt, set_prompt_directory

# Optional global override.
set_prompt_directory(Path("prompts"))

# Load by tag from prompts/simple.txt
prompt = load_prompt("simple")

# Or pass an explicit root per call.
prompt = load_prompt("simple", prompt_root=Path("prompts"))

# Replace code placeholders like {{FROM_CODE:answer}}.
prompt = load_prompt(
    "simple",
    code_replacements={"answer": "42"},
    prompt_root=Path("prompts"),
)
```
