Metadata-Version: 2.4
Name: promptfletcher
Version: 0.2.0
Summary: PromptFletcher is a lightweight, deterministic auto-prompt engineering library for NLP and LLM workflows.
Home-page: https://github.com/Vikhram-S/PromptFletcher
Author: Vikhram S
Author-email: vikhrams@saveetha.ac.in
License: MIT
Project-URL: Homepage, https://github.com/Vikhram-S/PromptFletcher
Project-URL: Documentation, https://github.com/Vikhram-S/PromptFletcher#readme
Project-URL: Source, https://github.com/Vikhram-S/PromptFletcher
Project-URL: Bug Tracker, https://github.com/Vikhram-S/PromptFletcher/issues
Project-URL: Changelog, https://github.com/Vikhram-S/PromptFletcher/releases
Keywords: prompt-engineering,llm,nlp,natural-language-processing,ai,machine-learning,prompt-optimization,chatgpt,generative-ai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.7,<3.14
Description-Content-Type: text/markdown
Requires-Dist: nltk>=3.6
Requires-Dist: numpy>=1.21
Requires-Dist: regex>=2023.3.23
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# PromptFletcher 🚀
### Deterministic Auto-Prompt Engineering for Python & NLP

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/promptfletcher)
![PyPI - License](https://img.shields.io/pypi/l/promptfletcher)
![PyPI](https://img.shields.io/pypi/v/promptfletcher)
![PyPI - Status](https://img.shields.io/pypi/status/promptfletcher)
![PyPI - Monthly Downloads](https://img.shields.io/pypi/dm/promptfletcher)
![Total Downloads](https://static.pepy.tech/badge/promptfletcher)

---

## Overview

PromptFletcher is a lightweight, deterministic, and dependency-minimal Python library for automatic prompt refinement using classical NLP heuristics.

Unlike LLM-based prompt optimizers, PromptFletcher:

- Does not require external APIs
- Does not use large transformer models
- Works offline
- Produces reproducible results
- Is fast enough for CI, batch jobs, and research pipelines

It is ideal for developers, researchers, and teams who want structured prompt improvement without LLM overhead.

---

## Key Capabilities

- Heuristic-based prompt evaluation
- Iterative prompt refinement
- Context-aware relevance scoring
- Fast execution using NLTK
- Deterministic and reproducible behavior
- Minimal runtime footprint

---

## Installation

### Install from PyPI (recommended)

pip install promptfletcher

### Install from GitHub (latest)

pip install git+https://github.com/Vikhram-S/PromptFletcher.git

On first use, required NLTK resources are downloaded automatically.

---

## Quick Start

### Initialize the Engine

from promptfletcher import AutoPromptEngineer

engineer = AutoPromptEngineer()

### Define Context and Prompt

context = "We are optimizing prompt quality for large language models."
prompt = "How improve AI responses"

### Refine the Prompt

refined = engineer.refine_prompt(prompt, context)
print(refined)

Example output:

How improve AI responses? Please explain in detail.

---

## How It Works

PromptFletcher applies classical NLP heuristics to evaluate and refine prompts:

| Heuristic  | Description |
|-----------|-------------|
| Length    | Penalizes prompts that are too short or too verbose |
| Clarity   | Rewards explicit questions |
| Relevance | Measures keyword overlap with context |
| Iteration | Keeps only prompt improvements |

This design makes the system predictable, explainable, and easy to debug.

---

## API Reference

### AutoPromptEngineer

refine_prompt(prompt: str, context: str, iterations: int = 3) -> str  
Refines a prompt iteratively using heuristic scoring.

evaluate_prompt(prompt: str, context: str) -> float  
Returns a numeric quality score for a prompt.

---

## Use Cases

- Prompt standardization in teams
- Automated prompt cleanup pipelines
- Prompt benchmarking
- Research experiments
- CI validation of prompts
- Offline prompt tuning
- Educational NLP projects

---

## Dependencies

PromptFletcher keeps dependencies intentionally minimal:

- nltk >= 3.6
- numpy >= 1.21
- regex >= 2023.3.23

---

## License

PromptFletcher is released under the MIT License.  
You are free to use, modify, and distribute this software.

---

## Contributing

Contributions are welcome.

Workflow:

1. Fork the repository
2. Create a branch (feature/your-feature)
3. Commit your changes
4. Push and open a Pull Request

Please ensure code is typed, documented, and non-breaking.

---

## Support and Contact

Issues: https://github.com/Vikhram-S/PromptFletcher/issues  
Email: vikhrams@saveetha.ac.in

---

## Support the Project

If PromptFletcher helps you:

- Star the repository
- Use it in your projects
- Share it with others

Your support helps grow the project.
