A version control tool for prompts
Project description
PromptLog
A version control tool for prompts, designed to help you manage, track, and compare different versions of your prompts.
Features
- Version Management: Create, save, and load different versions of prompts
- Version Comparison: Compare different versions of prompts to see changes
- Metadata Tracking: Record information about each version (timestamp, author, description, etc.)
- Local Storage: Store prompts and their versions locally on your file system
Installation
pip install promptlog
Usage
Basic Usage
from promptlog import PromptManager
# Initialize prompt manager
pm = PromptManager("my_prompt_project")
# Create and save a new prompt version
pm.save_prompt(
name="welcome_message",
content="Hello, welcome to our service!",
description="Initial welcome message",
author="John Doe"
)
# Update the prompt and save as a new version
pm.save_prompt(
name="welcome_message",
content="Hello, welcome to our improved service!",
description="Updated welcome message with improved wording",
author="John Doe"
)
# List all versions of a prompt
versions = pm.list_versions("welcome_message")
print(versions)
# Load a specific version
prompt_v1 = pm.load_version("welcome_message", version=1)
print(prompt_v1.content)
# Compare two versions
comparison = pm.compare_versions("welcome_message", version1=1, version2=2)
print(comparison)
Advanced Features
# Search prompts by metadata
prompts = pm.search_prompts(author="John Doe")
# Get prompt history
history = pm.get_prompt_history("welcome_message")
# Delete a specific version
pm.delete_version("welcome_message", version=1)
# Delete all versions of a prompt
pm.delete_prompt("welcome_message")
API Reference
PromptManager
__init__(project_name, storage_path=None): Initialize the prompt managersave_prompt(name, content, description="", author="", tags=None): Save a new prompt versionlist_versions(name): List all versions of a promptload_version(name, version): Load a specific version of a promptcompare_versions(name, version1, version2): Compare two versions of a promptsearch_prompts(**kwargs): Search prompts by metadataget_prompt_history(name): Get the full history of a promptdelete_version(name, version): Delete a specific versiondelete_prompt(name): Delete all versions of a prompt
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
promptlog-0.1.0.tar.gz
(11.0 kB
view details)
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 promptlog-0.1.0.tar.gz.
File metadata
- Download URL: promptlog-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a18cbf3c45a1684e02da9ec8e88aedc4731a47846b6f7b78aabbc66e81b4e9c8
|
|
| MD5 |
20c5e3925afad21de3891a4690f46583
|
|
| BLAKE2b-256 |
e5b038b81038e4f38b8c1264ab7c454583ec79639d3a1a826611f215bbe52ebb
|
File details
Details for the file promptlog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: promptlog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bb443caf3cf53d2cd357de435dcb87a9d809797a59126f814c5bbd3530f363c
|
|
| MD5 |
feb8d3a691e823a87d12ed4e4ff0e302
|
|
| BLAKE2b-256 |
4b88cac4b3e7fa0a01c75536df8c3674ba280fa0760115e032d34159e281ddae
|