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.1.tar.gz (12.5 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.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parolo-0.2.1.tar.gz
  • Upload date:
  • Size: 12.5 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.1.tar.gz
Algorithm Hash digest
SHA256 0e8c692171f0d61506985adc8103e4fd1cc8ecf9b0493bb879260bba4c9f4969
MD5 8cfce152e4a5257f3ca248ca0d6497c7
BLAKE2b-256 f102d3bcffb547dd729fe4e64df8c8f6cf48cf491bedda49a89521a03915c64a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parolo-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e2939cd5e90c3eb3891523011452424652798a8f5b15acce9aa7d2501b327b2
MD5 c2d5e334ed4b4cd8aa9c7665b3041db3
BLAKE2b-256 b2552abc874e852482fade0265e7600c7319f7b69dd261d5840ae3e729cc446e

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