Prompt loading with recursive includes and code substitution.
Project description
pastr
Prompt loading utilities.
Install
After the first PyPI release:
uv add pastr
Fallback before a package release is published:
uv add "pastr @ git+https://github.com/jjstankowicz/pastr.git@v0.1.0"
Release steps are documented in docs/pypi-release.md.
Quick Start
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"),
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pastr-0.1.0.tar.gz.
File metadata
- Download URL: pastr-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03af7514a59aca549d194c42fa08adda03be8ad6b2a7b2bdc5cd4b3f192fc8bd
|
|
| MD5 |
e7885fd343fd13f92dec90434dfcd7d9
|
|
| BLAKE2b-256 |
ac6a593da47697fcd81ee763322bc43480a141b138a6ad616b0b643ba3cc786f
|
Provenance
The following attestation bundles were made for pastr-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on jjstankowicz/pastr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pastr-0.1.0.tar.gz -
Subject digest:
03af7514a59aca549d194c42fa08adda03be8ad6b2a7b2bdc5cd4b3f192fc8bd - Sigstore transparency entry: 1089197304
- Sigstore integration time:
-
Permalink:
jjstankowicz/pastr@7bbac04be63535e361d6a30e71ce929cf98e95a7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jjstankowicz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7bbac04be63535e361d6a30e71ce929cf98e95a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pastr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pastr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28b38f5b30a4a114f01372e697b9733aa20bbe7f80aec005839a2a21cc77482e
|
|
| MD5 |
4c9560eea1a08790377116b033754d9c
|
|
| BLAKE2b-256 |
5cb58404cc5948465b49f77a2bae5dbd59d334fb3c666846cc8d77793abc525e
|
Provenance
The following attestation bundles were made for pastr-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on jjstankowicz/pastr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pastr-0.1.0-py3-none-any.whl -
Subject digest:
28b38f5b30a4a114f01372e697b9733aa20bbe7f80aec005839a2a21cc77482e - Sigstore transparency entry: 1089197312
- Sigstore integration time:
-
Permalink:
jjstankowicz/pastr@7bbac04be63535e361d6a30e71ce929cf98e95a7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jjstankowicz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7bbac04be63535e361d6a30e71ce929cf98e95a7 -
Trigger Event:
push
-
Statement type: