|
| 1 | +# **Python Prompt Generator Tool** |
| 2 | + |
| 3 | +This Python script efficiently generates customized prompts using a template and a CSV file containing key-value pairs. |
| 4 | + |
| 5 | +## **Installation** |
| 6 | + |
| 7 | +**Prerequisites:** |
| 8 | + |
| 9 | +* Python (version 3.x recommended) |
| 10 | + |
| 11 | +**Steps:** |
| 12 | + |
| 13 | +1. **Clone or download the repository:** (Add instructions if the project is on GitHub or similar) |
| 14 | +2. **Install dependencies:** |
| 15 | + ```bash |
| 16 | + pip install -r requirements.txt |
| 17 | + ``` |
| 18 | + |
| 19 | +## **Usage** |
| 20 | + |
| 21 | +**1. Prepare your files:** |
| 22 | + |
| 23 | + * **key-values.csv:** |
| 24 | + * Create a CSV file with columns representing the keys to be replaced in your template. |
| 25 | + * Each row will define the values for a single prompt. |
| 26 | + |
| 27 | + * **prompt.txt:** |
| 28 | + * Design your prompt template. |
| 29 | + * Enclose keys from 'key-values.csv' within `**/key/**` tags (e.g., `**/city/**`). |
| 30 | + |
| 31 | +**2. Run the script:** |
| 32 | + |
| 33 | + ```bash |
| 34 | + python main.py [--description-mode] |
| 35 | + ``` |
| 36 | + |
| 37 | + * **Optional:** Use `--description-mode` to exclude titles and focus on city names in your prompts. |
| 38 | + |
| 39 | +## **Explanation** |
| 40 | + |
| 41 | +* **CSV File ('key-values.csv')** |
| 42 | + Each column header represents a key to be replaced. Rows contain corresponding values. See example: |
| 43 | + |
| 44 | + ```csv |
| 45 | + title, city, country |
| 46 | + Explore the Charm of, Paris, France |
| 47 | + A Journey Through, Tokyo, Japan |
| 48 | + ``` |
| 49 | + |
| 50 | +* **Prompt Template ('prompt.txt')** |
| 51 | + Use `**/key/**` to mark replacement points. Example: |
| 52 | + |
| 53 | + ``` |
| 54 | + Write a travel blog titled "**/title/**" about the captivating city of **/city/**, **/country/**. |
| 55 | + ``` |
| 56 | + |
| 57 | +* **Output** |
| 58 | + Generated prompts are saved as individual .txt files within a specified folder. |
| 59 | + ``` |
| 60 | + Write a travel blog titled "Explore the Charm of" about the captivating city of Paris, France. |
| 61 | + ``` |
| 62 | + |
| 63 | +## **Terminology** |
| 64 | + |
| 65 | +* **key:** A column header in 'key-values.csv', used as an identifier in the template. |
| 66 | +* `**/key/**`: Indicates a placeholder in the template, to be substituted with values from 'key-values.csv'. |
| 67 | + |
| 68 | +## **Contributing** |
| 69 | + |
| 70 | +Feel free to submit bug reports, feature requests, and pull requests! |
| 71 | + |
| 72 | +## **License** |
| 73 | + |
| 74 | +[Include the appropriate license for your project] |
| 75 | + |
| 76 | +## **Key Improvements:** |
| 77 | + |
| 78 | +* **Concise and Clear Title:** Emphasizes the tool's main functionality. |
| 79 | +* **Structured Installation:** Guides users with prerequisites and step-by-step instructions. |
| 80 | +* **Detailed Usage:** Explains file preparation and script execution with clarifying examples. |
| 81 | +* **Enhanced Explanation:** Provides visuals to demonstrate the CSV structure and prompt template format. |
| 82 | +* **Consistent Terminology:** Maintains a glossary for easy reference. |
| 83 | +* **Inviting Contributions and Licensing:** Encourages community engagement and clarifies usage rights. |
| 84 | + |
| 85 | + |
| 86 | +## **Known Exceptions and Error:** |
0 commit comments