Skip to content

Commit acecda6

Browse files
author
Muhammad Ali
committed
asdf
1 parent 270b407 commit acecda6

File tree

7 files changed

+336
-168
lines changed

7 files changed

+336
-168
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
paid.py
1+
paid.py
22
__pycache__

README.md

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
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.**
14-
2. **Install dependencies:**
15-
```bash
16-
pip install -r requirements.txt
17-
```
18-
19-
## **Usage**
20-
21-
**1. Understand your files (Not necessary already done.):**
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 [-d]
35-
```
36-
37-
* **Optional:** Use `-d` to exclude titles and focus on city names in your prompts.
38-
39-
> This feature is currently not optimized.
40-
41-
## **Explanation**
42-
43-
* **CSV File ('key-values.csv')**
44-
Each column header represents a key to be replaced. Rows contain corresponding values. See example:
45-
46-
```csv
47-
title, city, country
48-
Explore the Charm of, Paris, France
49-
A Journey Through, Tokyo, Japan
50-
```
51-
![keyvalue.csv Example](/assets/keyvalues.csv_example.png)
52-
53-
54-
* **Prompt Template ('prompt.txt')**
55-
Use `**/key/**` to mark replacement points. Example:
56-
57-
```
58-
Write a travel blog titled "**/title/**" about the captivating city of **/city/**, **/country/**.
59-
```
60-
![prompt.txt Example](/assets/prompt.txt_example.png)
61-
62-
![key_example1](/assets/key_example1.png) ![key_example2](/assets/key_example2.png)
63-
64-
* **Output**
65-
Generated prompts are saved as individual .txt files within a specified folder.
66-
```
67-
Write a travel blog titled "Explore the Charm of" about the captivating city of Paris, France.
68-
```
69-
70-
## **Terminology**
71-
72-
* **key:** A column header in 'key-values.csv', used as an identifier in the template.
73-
* `**/key/**`: Indicates a placeholder in the template, to be substituted with values from 'key-values.csv'.
74-
75-
76-
## **Exceptions and Error:**
77-
- Template file is empty. Please add some text to it.
78-
79-
`You need to check your prompt.txt. It might be empty.`
80-
81-
- CSV file is empty. Please add some data to it.
82-
83-
`You need to check your key-values.cv. It might be empty.`
84-
85-
86-
- Invalid CSV Headers **`OR`** Invalid CSV columns count. Please make sure the CSV file has the correct format..
87-
88-
`For now the key-value and template is hard coded. The paid file only works for two key-values City and Title. Make sure the current headers are City,Title. Not less or More`
89-
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.**
14+
2. **Install dependencies:**
15+
```bash
16+
pip install -r requirements.txt
17+
```
18+
19+
## **Usage**
20+
21+
**1. Understand your files (Not necessary already done.):**
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 [-d]
35+
```
36+
37+
* **Optional:** Use `-d` to exclude titles and focus on city names in your prompts.
38+
39+
> This feature is currently not optimized.
40+
41+
## **Explanation**
42+
43+
* **CSV File ('key-values.csv')**
44+
Each column header represents a key to be replaced. Rows contain corresponding values. See example:
45+
46+
```csv
47+
title, city, country
48+
Explore the Charm of, Paris, France
49+
A Journey Through, Tokyo, Japan
50+
```
51+
![keyvalue.csv Example](/assets/keyvalues.csv_example.png)
52+
53+
54+
* **Prompt Template ('prompt.txt')**
55+
Use `**/key/**` to mark replacement points. Example:
56+
57+
```
58+
Write a travel blog titled "**/title/**" about the captivating city of **/city/**, **/country/**.
59+
```
60+
![prompt.txt Example](/assets/prompt.txt_example.png)
61+
62+
![key_example1](/assets/key_example1.png) ![key_example2](/assets/key_example2.png)
63+
64+
* **Output**
65+
Generated prompts are saved as individual .txt files within a specified folder.
66+
```
67+
Write a travel blog titled "Explore the Charm of" about the captivating city of Paris, France.
68+
```
69+
70+
## **Terminology**
71+
72+
* **key:** A column header in 'key-values.csv', used as an identifier in the template.
73+
* `**/key/**`: Indicates a placeholder in the template, to be substituted with values from 'key-values.csv'.
74+
75+
76+
## **Exceptions and Error:**
77+
- Template file is empty. Please add some text to it.
78+
79+
`You need to check your prompt.txt. It might be empty.`
80+
81+
- CSV file is empty. Please add some data to it.
82+
83+
`You need to check your key-values.cv. It might be empty.`
84+
85+
86+
- Invalid CSV Headers **`OR`** Invalid CSV columns count. Please make sure the CSV file has the correct format..
87+
88+
`For now the key-value and template is hard coded. The paid file only works for two key-values City and Title. Make sure the current headers are City,Title. Not less or More`
89+

key-values.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
City,Title
2-
city1,title1
3-
City2,title2
1+
City,Title
2+
city1,title1
3+
City2,title2
44
city3,title3

main.py

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,20 @@
1-
import sys
2-
import os
3-
import requests
4-
5-
def authorize():
6-
response = requests.get(
7-
url="https://auth-server.muhammad-ali.workers.dev/",
8-
headers={"Token": "HGTK-LKER-JHSH-NDSX"}
9-
)
10-
if response.status_code == 403:
11-
if os.path.exists("script.py"):
12-
os.remove("script.py")
13-
print("Invalid Token. Please contact the developer for a valid token.")
14-
input("Press Enter to exit.")
15-
exit()
16-
else:
17-
if not os.path.exists("script.py"):
18-
url = response.text
19-
response = requests.get(url)
20-
with open("script.py", "w" , encoding="utf-8") as file:
21-
file.write(response.text)
22-
23-
24-
25-
if __name__ == "__main__":
26-
authorize()
27-
import script
28-
if len(sys.argv) != 1:
29-
if sys.argv[1] == "-d":
30-
script.main(True)
31-
elif sys.argv[1] == "-h" or sys.argv[1] == "--help":
32-
script.help()
33-
else:
34-
script.print_warning("Invalid Argument. Use -h or --help for help.")
35-
else:
36-
script.main()
37-
38-
if script.error:
39-
script.print_info("Visit Github for more information and help: https://github.com/tensor35/Python-Prompt-Generator-Script")
40-
print("\n")
41-
if os.path.exists("script.py"):
42-
os.remove("script.py")
1+
import sys
2+
import os
3+
import requests
4+
5+
if __name__ == "__main__":
6+
import script
7+
if len(sys.argv) != 1:
8+
if sys.argv[1] == "-d":
9+
script.main(True)
10+
elif sys.argv[1] == "-h" or sys.argv[1] == "--help":
11+
script.help()
12+
else:
13+
script.print_warning("Invalid Argument. Use -h or --help for help.")
14+
else:
15+
script.main()
16+
17+
if script.error:
18+
script.print_info("Visit Github for more information and help: https://github.com/tensor35/Python-Prompt-Generator-Script")
19+
print("\n")
4320
exit()

prompt.txt

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
Escribeme 1 contenido de texto en idioma español para un articulo / blog para
2-
backlink de una website de anuncios putas en **/City/** (deben de ser SEO
3-
poderosos y deben de contenr unos 1000-1700 Caracteres como Maximo Y EN
4-
idioma español,el header o titulo de cada articulo debe de contener la keyword
5-
"escorts" y no necesariamente las keywords similiras otras que te e
6-
proporcionado,el texto debe estar balanceado entre las keywords "escort" y
7-
"putas" menos de un 3-4% de densidad y mas de un 1% siempre,Tambien la
8-
keyword “**/City/**” debe de tener un keyword density mas bajo del 3% en el texto
9-
que me proporciones esto es muy importante que lo tengas en cuenta, el
10-
articulo debe tratarse de lo siguiente :"**/Title/**" ,ahora haz el articulo haciendo uso como
11-
referencia de la siguiente lista de keywords:
12-
putas **/City/**
13-
putas en **/City/**
14-
putas maduras **/City/**
15-
putas independientes **/City/**
16-
putas baratas **/City/**
17-
putas de lujo **/City/**
18-
masajes putas **/City/**
19-
anuncios putas **/City/** escorts-alicante.com
20-
DETAILS BOT FOR GENERATE CHATGPT SCRIPT FILES 4
21-
encuentros putas **/City/**
22-
compañia
23-
putas **/City/** escorts-alicante.com
24-
escorts **/City/**
25-
escort **/City/**
26-
escorts de lujo **/City/**
27-
chicas escort **/City/**
28-
escort en **/City/**
29-
putas
30-
acompañantes
31-
acompañantes **/City/**
1+
Escribeme 1 contenido de texto en idioma español para un articulo / blog para
2+
backlink de una website de anuncios putas en **/City/** (deben de ser SEO
3+
poderosos y deben de contenr unos 1000-1700 Caracteres como Maximo Y EN
4+
idioma español,el header o titulo de cada articulo debe de contener la keyword
5+
"escorts" y no necesariamente las keywords similiras otras que te e
6+
proporcionado,el texto debe estar balanceado entre las keywords "escort" y
7+
"putas" menos de un 3-4% de densidad y mas de un 1% siempre,Tambien la
8+
keyword “**/City/**” debe de tener un keyword density mas bajo del 3% en el texto
9+
que me proporciones esto es muy importante que lo tengas en cuenta, el
10+
articulo debe tratarse de lo siguiente :"**/Title/**" ,ahora haz el articulo haciendo uso como
11+
referencia de la siguiente lista de keywords:
12+
putas **/City/**
13+
putas en **/City/**
14+
putas maduras **/City/**
15+
putas independientes **/City/**
16+
putas baratas **/City/**
17+
putas de lujo **/City/**
18+
masajes putas **/City/**
19+
anuncios putas **/City/** escorts-alicante.com
20+
DETAILS BOT FOR GENERATE CHATGPT SCRIPT FILES 4
21+
encuentros putas **/City/**
22+
compañia
23+
putas **/City/** escorts-alicante.com
24+
escorts **/City/**
25+
escort **/City/**
26+
escorts de lujo **/City/**
27+
chicas escort **/City/**
28+
escort en **/City/**
29+
putas
30+
acompañantes
31+
acompañantes **/City/**
3232
acompañantes en **/City/**

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
colorama
2-
pandas
1+
colorama
2+
pandas
33
requests

0 commit comments

Comments
 (0)