Skip to main content

A version-controlled prompt system for LLM workflows.

Project description

Parolo

A tiny, file-based prompt store with automatic versioning. Simple defaults, zero infra, backward compatible with the original Prompt class.

  • Stores the current prompt in latest.txt
  • Creates immutable versions under versions/vNNNN.txt (+ vNNNN.json metadata)
  • Atomic writes so readers never see partial files
  • Optional function API with Jinja2 rendering
  • Works out of the box on a single machine or shared volume
from parolo import prompts, Prompt  # new + old

# New, namespaced API
prompts.save("greeting", "Hello {{name}}!")
print(prompts.render("greeting", name="Matthias"))

# Old class API (back-compat, str.format)
Prompt.create("legacy", "Hi {name}")
print(Prompt.format_prompt("legacy", name="Matthias"))

Installation

uv pip install parolo

By default, parolo stores data in ~/.parolo/prompts/. Override with PAROLO_HOME=/path/to/dir.

Or in code: from parolo import set_base_dir; set_base_dir("/path/to/dir")


Listing & history

from parolo import prompts

# All prompts (quick stats)
print(prompts.list())
# → [{'name': 'email_refund', 'versions': 3, 'has_latest': True, 'latest_version': 'v0003', ...}, ...]

# All versions for one prompt (filenames)
print(prompts.versions("email_refund"))
# → ['v0001.txt', 'v0002.txt', 'v0003.txt']

# With metadata (timestamp, hash, size, detected Jinja variables)
print(prompts.versions("email_refund", with_meta=True))
# → [{'file':'v0003.txt','version':'v0003','timestamp':'...','hash':'...','size':123,'line_count':3,'jinja_variables':['customer','order_id']}, ...]

# Metadata for one version
print(prompts.meta("email_refund", "v0001"))

Hot reload (agents)

Poll the file’s mtime token; reload when it changes.

import time
from parolo import token, get

name = "email_refund"
t = token(name)
tmpl = get(name)

while True:
    time.sleep(1.0)
    nt = token(name)
    if nt != t:
        t = nt
        tmpl = get(name)  # reload latest.txt
        # update your in-memory template

File Structure with Metadata

~/.parolo/prompts/
├── code_review/
│   ├── latest.txt
│   └── versions/
│       ├── v0001.txt           # Prompt content
│       ├── v0001.json          # Metadata (hash, timestamp, etc.)
│       ├── v0002.txt
│       └── v0002.json

Each .json file contains:

  • hash: SHA-256 hash of the prompt content
  • timestamp: ISO format creation timestamp
  • version: Version identifier (e.g., "v0001")
  • size: Size in bytes
  • line_count: Number of lines
  • previous_hash: Hash of the previous version
  • metadata: Custom metadata provided by user

Features

  • Automatic Versioning: Only creates new versions when content actually changes (using SHA-256 hashing)
  • Rich Metadata: Stores timestamp, hash, size, and custom metadata with each version
  • Version History: Git-like log functionality to view version history
  • Latest File: Always maintains a latest.txt file with the current version
  • Organized Storage: Clean directory structure for easy browsing
  • Simple API: Intuitive class-based interface with static methods
  • Flexible Configuration: Customizable storage location

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parolo-0.2.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parolo-0.2.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file parolo-0.2.0.tar.gz.

File metadata

  • Download URL: parolo-0.2.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for parolo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d1224a335ebae0deda1bf43b30fa0d9606953e6f36750676abdaacb4818e8135
MD5 098d95aea84c7e93dd19f55e24c4fd0c
BLAKE2b-256 217299c98bd85d3bbc16d8cf23510eeb1b26fee6b12d869bceb51274caaff031

See more details on using hashes here.

File details

Details for the file parolo-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: parolo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for parolo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6bdb93c2d0fc7ab06baf6d04789dfdbb27cf4e8dcd244ecf18262d9c58757e8
MD5 7aae4f54ed4268988d47426281ffd1fb
BLAKE2b-256 649199d2ad34084823cd6d18497e0916cd87fcea4ac5bdcb8bea676338e7caf0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page