# promptev-client
A lightweight Python SDK to securely fetch and format prompts from [Promptev.ai](https://promptev.ai) using your project API key.
---
## Installation
```bash
pip install promptev
```
> Optional (recommended for production caching and background refresh):
```bash
pip install cachetools
```
---
## What is Promptev?
[Promptev](https://promptev.ai) helps teams manage, version, and collaborate on AI prompts at scale — with variables, live context packs, histories, cost estimation, and SDK access.
---
## Usage
### 1. Initialize the client
```python
from promptev import PromptevClient
client = PromptevClient(project_key="pv_sk_abc123yourkey")
```
---
### 2. Fetch a prompt with variables
```python
output = client.get_prompt("onboarding-email", {
"name": "Ava",
"product": "Promptev"
})
print(output)
# Output: "Subject: Welcome, Ava! Hey Ava, Thanks for joining Promptev..."
```
---
### 3. Fetch a prompt without variables
```python
output = client.get_prompt("static-welcome")
print(output)
# Output: "You are a helpful AI assistant ready to support the user."
```
> ⚠️ If the prompt has no variables, you can omit the second argument.
---
### 4. Async Usage (e.g. in FastAPI or notebooks)
```python
import asyncio
async def run():
prompt = await client.aget_prompt("faq-response", {
"question": "How do I reset my password?"
})
print(prompt)
asyncio.run(run())
```
---
## Example: Use with LLM APIs
### OpenAI
```python
from openai import OpenAI
client = OpenAI(api_key="sk-...")
prompt = promptev_client.get_prompt("explain-topic", {
"topic": "Prompt Engineering"
})
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": prompt}]
)
print(response.choices[0].message.content)
```
---
## Features
- ✅ Supports prompts with or without variables
- 🔁 Smart caching (via `dict` or `TTLCache`)
- 🧠 Built-in variable formatting & validation
- ⚡ Sync + Async compatible
- 🔐 Works with any LLM (OpenAI, Claude, Gemini, etc.)
- 🔌 BYOK + airgapped environment ready
---
## Error Handling
```python
# ❌ Missing required variable
client.get_prompt("onboarding-email", { "name": "Leo" })
# ➜ ValueError: Missing required variables: product
```
---
## Prompt Template Example
```text
Subject: Welcome, {{ name }}!
Hey {{ name }},
Thanks for joining {{ product }}. We're thrilled to have you on board!
```
---
## License
This SDK is **commercial software** by Promptev Inc.
By using this package, you agree to the terms in [`LICENSE.txt`](./LICENSE.txt).
- ✅ Free tier use allowed
- 🚫 Production usage requires a subscription
---
## Contact
- 🌐 [https://promptev.ai](https://promptev.ai)
- 📧 support@promptev.ai
Raw data
{
"_id": null,
"home_page": null,
"name": "promptev",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "Promptev, promptev, prompts, api, client, sdk, ai, promptDev, promptdev, promptops, python",
"author": null,
"author_email": "Promptev Inc <support@promptev.ai>",
"download_url": "https://files.pythonhosted.org/packages/1c/cf/5c405c24793508ffe6c85ab4beb166ef127738bafe4d61c7ce9965403ffa/promptev-0.0.1.tar.gz",
"platform": null,
"description": "# promptev-client\n\nA lightweight Python SDK to securely fetch and format prompts from [Promptev.ai](https://promptev.ai) using your project API key.\n\n---\n\n## Installation\n\n```bash\npip install promptev\n```\n\n> Optional (recommended for production caching and background refresh):\n```bash\npip install cachetools\n```\n\n---\n\n## What is Promptev?\n\n[Promptev](https://promptev.ai) helps teams manage, version, and collaborate on AI prompts at scale \u2014 with variables, live context packs, histories, cost estimation, and SDK access.\n\n---\n\n## Usage\n\n### 1. Initialize the client\n\n```python\nfrom promptev import PromptevClient\n\nclient = PromptevClient(project_key=\"pv_sk_abc123yourkey\")\n```\n\n---\n\n### 2. Fetch a prompt with variables\n\n```python\noutput = client.get_prompt(\"onboarding-email\", {\n \"name\": \"Ava\",\n \"product\": \"Promptev\"\n})\n\nprint(output)\n# Output: \"Subject: Welcome, Ava! Hey Ava, Thanks for joining Promptev...\"\n```\n\n---\n\n### 3. Fetch a prompt without variables\n\n```python\noutput = client.get_prompt(\"static-welcome\")\nprint(output)\n# Output: \"You are a helpful AI assistant ready to support the user.\"\n```\n\n> \u26a0\ufe0f If the prompt has no variables, you can omit the second argument.\n\n---\n\n### 4. Async Usage (e.g. in FastAPI or notebooks)\n\n```python\nimport asyncio\n\nasync def run():\n prompt = await client.aget_prompt(\"faq-response\", {\n \"question\": \"How do I reset my password?\"\n })\n print(prompt)\n\nasyncio.run(run())\n```\n\n---\n\n## Example: Use with LLM APIs\n\n### OpenAI\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(api_key=\"sk-...\")\n\nprompt = promptev_client.get_prompt(\"explain-topic\", {\n \"topic\": \"Prompt Engineering\"\n})\n\nresponse = client.chat.completions.create(\n model=\"gpt-4\",\n messages=[{\"role\": \"user\", \"content\": prompt}]\n)\n\nprint(response.choices[0].message.content)\n```\n\n---\n\n## Features\n\n- \u2705 Supports prompts with or without variables\n- \ud83d\udd01 Smart caching (via `dict` or `TTLCache`)\n- \ud83e\udde0 Built-in variable formatting & validation\n- \u26a1 Sync + Async compatible\n- \ud83d\udd10 Works with any LLM (OpenAI, Claude, Gemini, etc.)\n- \ud83d\udd0c BYOK + airgapped environment ready\n\n---\n\n## Error Handling\n\n```python\n# \u274c Missing required variable\nclient.get_prompt(\"onboarding-email\", { \"name\": \"Leo\" })\n# \u279c ValueError: Missing required variables: product\n```\n\n---\n\n## Prompt Template Example\n\n```text\nSubject: Welcome, {{ name }}!\n\nHey {{ name }},\n\nThanks for joining {{ product }}. We're thrilled to have you on board!\n```\n\n---\n\n## License\n\nThis SDK is **commercial software** by Promptev Inc.\n\nBy using this package, you agree to the terms in [`LICENSE.txt`](./LICENSE.txt).\n\n- \u2705 Free tier use allowed\n- \ud83d\udeab Production usage requires a subscription\n\n---\n\n## Contact\n\n- \ud83c\udf10 [https://promptev.ai](https://promptev.ai)\n- \ud83d\udce7 support@promptev.ai\n",
"bugtrack_url": null,
"license": "Promptev SDK License\n \n Copyright \u00a9 2025 Promptev Inc.\n \n This software is proprietary and protected under applicable copyright laws.\n By using this software, you agree to the following:\n \n 1. You may use this SDK:\n - Free of charge on the Free Tier of Promptev services\n - For evaluation or development purposes\n - In production only with an active Promptev subscription\n \n 2. Restrictions:\n - You may NOT sublicense, distribute, or reverse-engineer this software\n - You may NOT modify or resell this SDK or derivative works\n - You may NOT use this SDK outside the Promptev API without a license\n \n 3. The SDK is provided \u201cAS IS\u201d without warranties. Promptev Inc. shall not be held liable for any damages.\n \n By using this software, you accept these terms. For licensing inquiries or enterprise use, contact support@promptev.ai.\n ",
"summary": "Promptev SDK for accessing Promptev API",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://promptev.ai"
},
"split_keywords": [
"promptev",
" promptev",
" prompts",
" api",
" client",
" sdk",
" ai",
" promptdev",
" promptdev",
" promptops",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "44ea68984acafff40b13f73b3a4dc644a1318c1e7c90978f17d8fcc6f75392c0",
"md5": "35f753a1fa15c24b6edf9dd0682abfe7",
"sha256": "ccd6c0d850b7e357720af0e273181e3177025c86de407b0063481bb02fcb8998"
},
"downloads": -1,
"filename": "promptev-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "35f753a1fa15c24b6edf9dd0682abfe7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4946,
"upload_time": "2025-08-05T01:43:27",
"upload_time_iso_8601": "2025-08-05T01:43:27.262508Z",
"url": "https://files.pythonhosted.org/packages/44/ea/68984acafff40b13f73b3a4dc644a1318c1e7c90978f17d8fcc6f75392c0/promptev-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1ccf5c405c24793508ffe6c85ab4beb166ef127738bafe4d61c7ce9965403ffa",
"md5": "dbc8afa8a6e1453369fa173e1e966a82",
"sha256": "4ab563172d2047a7b2a8cdbc9e4a53d8e3e9d0e81a3e6c4899a6723e27d6fa62"
},
"downloads": -1,
"filename": "promptev-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "dbc8afa8a6e1453369fa173e1e966a82",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4676,
"upload_time": "2025-08-05T01:43:28",
"upload_time_iso_8601": "2025-08-05T01:43:28.802026Z",
"url": "https://files.pythonhosted.org/packages/1c/cf/5c405c24793508ffe6c85ab4beb166ef127738bafe4d61c7ce9965403ffa/promptev-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-05 01:43:28",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "promptev"
}