📚 PromptBook
📝 Overview
PromptBook is a powerful and flexible prompt management library designed for AI-driven workflows. It allows users to create, manage, and execute prompts efficiently, including pre-prompts and post-prompts. The library integrates seamlessly with Ollama, enabling contextual AI conversations across multiple prompts.
🚀 Features
- Create & Manage Prompt Books: Organize prompts in structured prompt books.
- Pre & Post-Prompt Execution: Automatically process dependent prompts before and after the main prompt.
- Variable Substitution: Dynamically replace placeholders with user-defined or default values.
- Ollama Integration: Run prompts in AI models while maintaining context across multiple prompts.
- Git-Based Prompt Cloning: Clone prompt books from Git repositories for shared collaboration.
- Customizable Configuration: Modify API settings, debugging options, and more via
config.yaml.
📥 Installation
pip install promptbook
🔧 Configuration
After installation, a config.yaml file can be created in the project root to customize settings:
ollama:
model: "llama3:2b"
stream: true
debug: false
api_url: "http://localhost:11434/api/chat"
tags_url: "http://localhost:11434/api/tags"
📖 Usage
1️⃣ Running a Prompt
To execute a prompt from a prompt book:
promptbook run test-prompt
2️⃣ Creating a New Prompt Book
To create a new prompt book:
promptbook create-book
The CLI will guide you through setting up the book structure and an initial prompt file.
3️⃣ Cloning a Prompt Book from GitHub
promptbook clone https://github.com/username/promptbook-repo.git
4️⃣ Debugging API Calls
Enable debug mode in config.yaml:
debug: true
5️⃣ Running a Prompt with Ollama
Each item in a prompt list will be executed sequentially while maintaining conversation context.
promptbook run my-prompt
Example output:
💬 Sending: What is the capital of France?
🧠 Ollama Response: The capital of France is Paris.
📂 File Structure
my-promptbook/
├── prompt-book.yaml # Book metadata
├── prompts/
│ ├── test-prompt.prompt
│ ├── another-prompt.prompt
🛠 Development & Contribution
- Clone the repository:
git clone https://github.com/yourusername/promptbook.git cd promptbook
- Install dependencies:
pip install -e .
- Run tests:
pytest tests/
📜 License
This project is licensed under the MIT License.
✨ Credits
Developed by Sharfuddin Shawon.
Metadata
Release files for promptbook 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| promptbook-0.5.0.tar.gz | 8.7 kB | Without provenance | Details for promptbook-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| promptbook-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for promptbook-0.5.0-py3-none-any.whl |
Total release size: 18.7 kB
Release files / promptbook-0.5.0.tar.gz
| Download URL | promptbook-0.5.0.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8b02ec7edaebdccd3365bd9a6ca585ca4d767d3ea46e304f5b2001fc3bc3ea8
|
|
BLAKE2b-256 checksum How to use checksums |
f80b1b2f46deec6a7f5eaa159e663ae1daf264ef43a777f6a7ae7295aa7ab766
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / promptbook-0.5.0-py3-none-any.whl
| Download URL | promptbook-0.5.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60975c581e22622dea4ceaeec75448ab3644f4f673d3b07a97457f23102aa248
|
|
BLAKE2b-256 checksum How to use checksums |
d4c5837cb41a5b10efcf58a3bd28c971822cf48297676c151025cad345e026c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for promptbook 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.