Metadata-Version: 2.4
Name: promptkit_1
Version: 0.1.1
Summary: A lightweight toolkit for cleaning and preparing text for LLMs
Project-URL: Repository, https://github.com/junaidify/promptkit
Author-email: Junaid Khan <junaidkhan23785@gmail.com>
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# promptkit 🧠

A lightweight Python toolkit for cleaning and preparing text before sending it to any LLM (GPT, Claude, Gemini, etc.)

Every AI developer copy-pastes these utilities across projects. Now you don't have to.

## Installation

pip install promptkit


## Functions

| Function | What it does |
|---|---|
| `clean(text)` | Removes extra spaces, repeated punctuation |
| `truncate_tokens(text, max_words)` | Trims text to stay within token limits |
| `remove_pii(text)` | Masks emails, phone numbers, URLs |
| `format_prompt(template, **kwargs)` | Safely fills prompt templates |
| `word_count(text)` | Returns word count of a string |

## Usage
```python
from promptkit import clean, truncate_tokens, remove_pii, format_prompt, word_count

# Clean messy input
clean("  Hello!!!   World???  ")
# → "Hello! World?"

# Truncate to token budget
truncate_tokens("one two three four five", max_words=3)
# → "one two three..."

# Remove sensitive info before sending to external APIs
remove_pii("My email is john@gmail.com and number is 9876543210")
# → "My email is [EMAIL] and number is [PHONE]"

# Fill prompt templates safely
format_prompt("Summarize: {text}", text="Hello world")
# → "Summarize: Hello world"

# Quick word count
word_count("Hello world foo bar")
# → 4
```

## Why promptkit?

- ✅ Zero dependencies — pure Python
- ✅ Works with any LLM — OpenAI, Anthropic, Google, local models
- ✅ PII removal keeps your users' data safe
- ✅ Token truncation saves API costs

## License

MIT — free to use, modify, and distribute.