Skip to main content

PromptPro - A prompt versioning and management system with Python bindings

Project description

PromptPro: Advanced Prompt Manage and Versioning System

Promptpro is a powerful, flexible, and developer-friendly prompt management system that revolutionizes how you manage, version, and organize your AI prompts. With built-in versioning, tagging, encryption, and a beautiful TUI interface, ppro is the ultimate tool for prompt engineers, AI developers, and anyone serious about prompt management.

Promptpro can be installed via python pip install promptpro, while underneath build with Rust 🦀, providing extremly fast speed. You can using any of your prompt in any language, any project, by simply given a unique key, and every single time you edit your prompt, there will be automatically version store, you never need multi files / messed up json yamls cross different agent projects.

Promptpro support both python and rust out of box!

✨ Key Features

  • 🔐 Secure Vault: Optional password-encrypted vault dumps for sensitive prompt data
  • 📦 Complete Backup: Full vault export/import functionality with binary format
  • 🔄 Automatic Versioning: Every prompt change is automatically versioned
  • 🏷️ Smart Tagging: Tag versions with "dev", "stable", "release", and custom tags
  • 💻 Beautiful TUI: Intuitive terminal user interface for easy navigation
  • 📝 Rich History: Track all changes with timestamps and optional messages
  • Blazing Fast Performance: Optimized storage with efficient retrieval (powered by Rust)
  • 🛠️ Developer Friendly: Comprehensive CLI and library API

🚀 Quick Start

Installation

Python:

pip install promptpro

Rust:

cargo install promptpro

Install from source:

# Clone the repository
git clone https://github.com/lucasjinreal/promptpro
cd promptpro

./install.sh

Basic Usage

ppro is the short form of promptpro. after install.sh it will available in your path.

# Add a new prompt
echo "Write a poem about technology" | ppro add

# Add with a key
ppro add "You are a helpful AI assistant"

# Update an existing prompt
ppro update my-prompt "You are a super helpful AI assistant"

# Get the latest version
ppro get my-prompt

# Get a specific version or tag
ppro get my-prompt 2
ppro get my-prompt stable

# Tag a version
ppro tag my-prompt stable 1

# Show history
ppro history my-prompt

# Open the TUI interface
ppro tui

📦 Backup & Restore

Export Your Vault

# Export without encryption (unencrypted binary)
ppro dump prompts.vault

# Export with password encryption
ppro dump prompts.vault --password "your-secret-password"

Import Your Vault

# Import unencrypted vault
ppro resume prompts.vault

# Import encrypted vault
ppro resume prompts.vault --password "your-secret-password"

🎮 TUI Interface

Navigate your prompts with the intuitive terminal interface:

  • Arrow Keys / hjkl: Navigate between panels and items
  • ← →: Switch between the 4 columns (Keys, Versions, Content, Tags)
  • Enter / x: Apply or toggle tags on selected versions
  • e: Edit content in the current panel
  • o: Open external editor (like vim, nano)
  • q: Quit the application
  • Ctrl+S: Save when in edit mode

🔧 Advanced CLI Commands

Tag Management

# Tag a specific version
ppro tag my-prompt stable 1

# Promote a tag to the latest version
ppro promote my-prompt stable

# The 'dev' tag is automatically promoted to latest version on updates

History & Retrieval

# Show full history for a prompt
ppro history my-prompt

# Get prompt to a file
ppro get my-prompt --output my-file.txt

# Get specific version
ppro get my-prompt 3

# Get by tag
ppro get my-prompt stable

🛠️ Programmatic API Usage

ppro can be easily integrated into both Rust and Python applications.

Rust API

Add to Cargo.toml

[dependencies]
promptpro = { path = "path/to/promptpro" }  # or git source

Basic Rust API Example

High level, write a PromptManager singleton:

use anyhow::Result;
use once_cell::sync::Lazy;
use promptpro::{PromptVault, VersionSelector};
use std::sync::Arc;
use tokio::sync::RwLock;

// Our global PromptManager singleton
pub struct PromptManager {
    vault: Arc<RwLock<PromptVault>>,
}

// Static global instance
static MANAGER: Lazy<PromptManager> = Lazy::new(|| {
    let vault = PromptVault::restore_or_default("./promptpro.vault", None)
        .expect("Failed to open PromptPro default vault");
    PromptManager {
        vault: Arc::new(RwLock::new(vault)),
    }
});

impl PromptManager {
    pub fn get() -> &'static Self {
        &MANAGER
    }

    pub async fn get_prompt(&self, key: &str, selector: VersionSelector<'_>) -> Result<String> {
        let vault = self.vault.read().await;
        Ok(vault.get(key, selector)?)
    }

    pub async fn latest(&self, key: &str) -> Result<String> {
        self.get_prompt(key, VersionSelector::Latest).await
    }
}

// Use

let pm = PromptManager::get();
let prompt = pm
    .get_prompt("pc_operator_v2", VersionSelector::Tag("dev"))
    .await
    .map_err(|e| AgentBuildError::PromptError(e.to_string()))?;

Low level API:

use ppro::{PromptVault, VersionSelector};

// Open the default vault
let vault = PromptVault::open_default()?;

// Add a new prompt
vault.add("greeting", "Hello, World!")?;

// Update an existing prompt
vault.update("greeting", "Hi there!", Some("Updated greeting".to_string()))?;

// Get latest version
let content = vault.get("greeting", VersionSelector::Latest)?;

// Tag a version
vault.tag("greeting", "stable", 1)?;

// Get by tag
let stable_content = vault.get("greeting", VersionSelector::Tag("stable"))?;

// Get history
let history = vault.history("greeting")?;

Backup & Restore API (Rust)

use ppro::PromptVault;

// Dump vault to binary file (with optional encryption)
let vault = PromptVault::open_default()?;
vault.dump("backup.vault", Some("my_password"))?;

// Or without encryption
vault.dump("backup.vault", None)?;

// Restore from binary file
let restored_vault = PromptVault::restore("backup.vault", Some("my_password"))?;

Complete Rust Example Program

use ppro::{PromptVault, VersionSelector};
use anyhow::Result;

#[tokio::main]
async fn main() -> Result<()> {
    let vault = PromptVault::open_default()?;

    // Add a prompt
    vault.add("summarization", "Summarize the following text concisely...")?;
    
    // Update with improvements
    vault.update("summarization", 
        "Provide a concise summary of the following text. Focus on key points and maintain context.",
        Some("Improved summarization prompt".to_string()))?;
    
    // Tag as stable
    vault.tag("summarization", "stable", 1)?;
    
    // Get the latest version
    let latest = vault.get("summarization", VersionSelector::Latest)?;
    println!("Latest prompt: {}", latest);
    
    // Get the stable version
    let stable = vault.get("summarization", VersionSelector::Tag("stable"))?;
    println!("Stable prompt: {}", stable);
    
    // Show history
    let history = vault.history("summarization")?;
    for version in history {
        println!("Version {}: ({}) {:?}",
            version.version, 
            version.timestamp.format("%Y-%m-%d %H:%M"),
            version.tags
        );
    }

    // Backup the vault
    vault.dump("backup.vault", Some("secure_password"))?;
    println!("Vault backed up successfully!");
    
    Ok(())
}

🐍 Python Bindings

ppro also provides Python bindings built with PyO3, making it easy to integrate prompt management into Python applications.

Installation

The Python package can be built and installed using Maturin:

pip install promptpro

Or if building from source:

cd promptpro
maturin build --features python
pip install target/wheels/promptpro-*.whl

Basic Python Usage

from promptpro import PromptManager

pm = PromptManager.get_singleton("promptpro.vault", "")
a = pm.get_prompt("pc_operator_v2", "dev")
print(a)

🎯 Why Choose ppro?

For Prompt Engineers

  • Version Control: Track every iteration of your prompts
  • A/B Testing: Maintain multiple versions and compare effectiveness
  • Rollback Capability: Instantly return to previous versions
  • Tag Management: Organize prompts by stability, project, or context

For AI Developers

  • API Integration: Easy programmatic access to your prompts
  • Environment Management: Different tags for dev/staging/prod
  • Team Collaboration: Share and sync prompt collections
  • Performance: Fast retrieval and minimal overhead

For Security-Conscious Teams

  • Encryption: Optional password protection for sensitive prompts
  • Binary Format: Secure, tamper-resistant backup format
  • Local Storage: Full control over your prompt data
  • Audit Trail: Complete history with timestamps

🏷️ Tagging System

Special Tags

  • dev: Automatically points to the latest version on updates
  • stable: Manually set for production-ready versions
  • release: For major releases or milestones

Custom Tags

You can create any custom tag names to organize your prompts:

# Create custom tags
ppro tag my-prompt experimental 2
ppro tag my-prompt production-ready 3
ppro tag my-prompt "v2.0" 4

📊 Use Cases

AI Model Development

  • Track prompt evolution during model training
  • A/B test different prompt variations
  • Maintain production vs. experimental prompts

Content Generation

  • Template management for marketing campaigns
  • Document generation prompts
  • Personalized content creation

Research & Experimentation

  • Maintain experiment logs with associated prompts
  • Compare prompt effectiveness across models
  • Share prompts within research teams

🤝 Contributing

We welcome contributions! Feel free to:

  • 🐛 Report bugs and issues
  • 💡 Suggest new features
  • 🔧 Submit pull requests
  • 📖 Improve documentation

📄 License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

GPL-3.0 License:

  • You can freely use, study, share, and modify this software
  • You must distribute source code when sharing
  • You must license derivative works under the same terms
  • You must preserve the original copyright notice and license

For more details, see the LICENSE file.


ppro - Taking prompt management to the next level! 🚀

Made with ❤️ for the AI development community.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

promptpro-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (875.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

promptpro-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (854.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

promptpro-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (760.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

promptpro-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (874.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

promptpro-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (853.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

promptpro-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (758.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

promptpro-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (875.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

promptpro-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (853.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

promptpro-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (758.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

promptpro-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (875.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

promptpro-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (854.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

promptpro-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (759.3 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

promptpro-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (875.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

promptpro-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (854.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

promptpro-0.1.0-cp38-cp38-macosx_11_0_arm64.whl (759.7 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file promptpro-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6fa8f0196eff49b434461550e7c98f351017deec8303077b9e05d5195148afd6
MD5 e9669af5579164bf5a192be0cfde58f4
BLAKE2b-256 d6f0ff742a94afe310eb28455bd00a042f0a06a9d69cd78a26e4115b6af57cb9

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4276898b26313eafaa31874815224f163e6727d3ce262d8ec6736070e52d8357
MD5 fe83c4cd9a75c7b95ff98d9ca230cb36
BLAKE2b-256 448abc7a4167fc43017e5c595b773d41ed609451d6060cdc0e0f0fcef9fe3d9f

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22cf7669fcc48c4390761e2caf9ac2a93338bcb3c1358a21b8c701a0145a237e
MD5 7a476db84e7d1bd6b6cda4dfebe7c64b
BLAKE2b-256 317d8859cc80cd90190bb67735537d6b718e4d3f9ec81251936fff2ea0812f44

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d856b48dc17af76fe862b86d58eb5eebdc83942d45d5442dbcf6dfe80db28b80
MD5 6e8c37c4f79e64779bbf2427236139ff
BLAKE2b-256 269e1328f21a34ffba1af4d1ccc9ecccbc48fa7b191d1a68143e28c152479488

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0f1c049bf6dd8636ea1c6feaae36be4eb467aee08b0eb193675a600734f70697
MD5 4e971803c5cb99aaa3c35cdb612cdf44
BLAKE2b-256 85fcd09a5bc6f5b68f31aac612354250a601f89cedafc13286f11dbf9f9c14b8

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49cc9e72c735016ea4a33ea887877de4a303b51836e544cccdf5920c8e177dd9
MD5 93af05ae87575479d6cdbf5dda5ce54e
BLAKE2b-256 a5f555671f0fec29410fc7640bbf37c43eaa4c0b8a9ed84367650dc1139e69c1

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38dd3f0e15d482a6ee0a4c51e0ef06aab8db4c74cceb0830ccd087ac202b097f
MD5 a5be16878c097839b4fc7e8d5143ee65
BLAKE2b-256 19ab3e2c589b3434d3c35145ee8dda07539fc7b4d31408964871241055017025

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fe5e81d3b7865bc5a630366ea17c8e7c4a6a4a980f89a996b2a0ad9814cf818a
MD5 7ca53b32494699d7256354c4acc700e6
BLAKE2b-256 bc9abc72fbdbf50de5dfefd64f43c59f490eb2ac178a337dc820927c0a8bbdb7

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c63bec5c66cf0a615da124ff668f946f6cf0700d7b25f077404ffc7af05a803
MD5 28f51e31feb33d296b9a0f255b265cfc
BLAKE2b-256 2f73fe5db2e3c517bb587537e91c5730255bea8911967fe6bcac01493d80b7b7

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 598641a2222590039c4ae63f7823a511218ce324d7cc9c2fcdb2f7af94630bda
MD5 262c93a82dbecdd2790cc5e10a45d844
BLAKE2b-256 b946b1fdd1b47aac6d70ae6cba30490ffce7d396e4abb944a7b05d625da35059

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0ce3df31a076ae795cc7f13ab73fdec6d1904d00e4cc8c32958bdbc70ca59f57
MD5 92f0d2cedfd7434e576735da5a944caf
BLAKE2b-256 90573344ec7cdef647c81f3783d0864d40ac6f054733d6f3e2e9de5f8cde730e

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc63810cc3b92dfe9e109851fa108ba63317aa2e40fb8cc1273b778d7fbc972e
MD5 a92d3f13d339013bd9a28c2739c7eefb
BLAKE2b-256 f785b8b6fdac1641e809305d7267bd37c7495cb539835663f3bd63ff0cc2b5c6

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4326b51be78b8727a310840bd3a627d70d1e9b65abfcf70b5aabe8a9dc5ef1d
MD5 a7b405cb381cb2411eb5dd1631897ad4
BLAKE2b-256 03b279ea3073c78ee7c239f748b1f73539dccf5c0290041343d9deb8995196c3

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d3ebae1442b7360936829bd0b015f36150ecbb0dc6e9837aa0e60f9d4981c1e3
MD5 f4124c580065b71ad32fae388241a4a7
BLAKE2b-256 4ee3121a2699a64efa0a1102c0e64f191bc62f4dd1ff484efbacad8b67407f97

See more details on using hashes here.

File details

Details for the file promptpro-0.1.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c59aced9db975aeef383f0b3831dcc2d38fc6265d95af4942719943f2cd33ec0
MD5 14e49815b00741f71cf24beffda3f04c
BLAKE2b-256 24b5333f4ec5172c755a34ac1e0ad064cd32606e0b860279ea8f098b52dae25c

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