merl 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: merl
3
- Version: 0.1.1
4
- Summary: A useless python lybrary
3
+ Version: 0.1.3
4
+ Summary: A useless python library, aiming to emulate (not fetch/embed) the Merl experience found on the minecraft.net help page! Again, this is NOT the real Merl, but a really close copy! If you use it enough!
5
5
  Home-page: https://github.com/O9Creeps/merl
6
6
  Author: O9CreeperBoi
7
7
  Author-email: example@example.com
merl-0.1.3/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # merl
2
+ An open-source useless python library that emulates (not fetches) some of Merl's most popular responses and answers. This may include some bonus ones that Merl does not actually say in the real thing, but come on who doesn't love a Minecraft Movie easter egg? Developed using the code.org IDE, because why not.
3
+ Use the following line on Windows to import merl:
4
+ ```
5
+ pip install merl
6
+ ```
7
+ If it says that 'pip.exe is blocked by group policy', try this:
8
+ ```
9
+ python -m pip install --user merl
10
+ ```
11
+ If THAT doesn't work, then give me some time to either fix my files or find another workaround.
12
+
13
+ ---
14
+ To update Merl:
15
+ ```
16
+ pip install --upgrade merl
17
+ ```
18
+ Or do:
19
+ ```
20
+ python -m pip install --upgrade --user merl
21
+ ```
22
+
23
+ ---
24
+ ## Functions I want you to use
25
+ ### send(pr)
26
+ Sends 'pr' to Merl where 'pr' is a string. The response automatically prints out in the terminal/IDE, so don't resize the window to less than the width of 40 characters wide. Otherwise the unprinting function breaks.
27
+
28
+ ### sendRaw(pr)
29
+ Sends 'pr' to Merl where 'pr' is a string. The response is returned as a string, so its nicely paired with a *print()* statement, like this:
30
+
31
+ ```Python
32
+ print(merl.sendRaw("Hello"))
33
+ ```
34
+ Because it has no unprinting function, this function is less likely to break the terminal.
35
+
36
+ ---
37
+ ## Modes
38
+ **NOTE: THESE FEATURES DO NOT WORK ON ACTUAL MERL, JUST PYTHON MERL!**
39
+ ### copyInput
40
+ To have Merl copy standard input to output, type "copyInput" in the send function, like this:
41
+
42
+ ```Python
43
+ merl.send("copyInput")
44
+ ```
45
+ This means that from now on, Merl will re-print whatever you put in send() until you tell them to stop using this:
46
+
47
+ ### resetInputs
48
+ Simply type "resetInputs" to have them go back to normal! Like this:
49
+
50
+ ```Python
51
+ merl.send("resetInputs")
52
+ ```
53
+
54
+ ---
55
+ ## Example Program using send()
56
+ This is an exaple program (used by me) to test Merl's capabilities and features:
57
+ ```Python
58
+ import merl
59
+ a = ""
60
+
61
+ while a != "!leave":
62
+ a = input("<you> ")
63
+ merl.send(a)
64
+ ```
65
+
66
+
67
+
68
+ ---
69
+ ## Functions that are supposed to be hidden
70
+ ### printanim(msg)
71
+ Prints 'msg' where 'msg' is a string. If 'msg' does not have spaces, then it all prints at once. Else, it prints word-by-word.
72
+ If 'msg' spans longer than the terminal's horizontal size, then it will start duplicating the messages with each line.
73
+ Keep each 'msg' short, like Merl!
74
+
75
+ ### replyPrint(prompt)
76
+ Where 'prompt' is a string. This forces Merl to reply whatever, based on what you put in.
77
+ The reason why there are 3 "send" functions is because it has Merl check a thing or two before actually doing the reply checks, too.
78
+ Expect "I don't know." to show up more than once. With the exception of your system's time being between 9 AM and 4 PM, of course, because then you get a high traffic message more than actual answers! (If that's what you could call them)
@@ -0,0 +1,234 @@
1
+ """
2
+ THANK YOU FOR IMPORTING THE MOST USELESS MODULE EVER CREATED!
3
+ I hope you hate it!
4
+
5
+ ---O9CreeperBoi
6
+
7
+ p.s. Hi, PhoenixSC!
8
+ """
9
+
10
+ import time
11
+ import random
12
+ import re
13
+
14
+ CURSOR_UP = "\033[1A"
15
+ CLEAR = "\x1b[2K"
16
+ CLEAR_LINE = CURSOR_UP + CLEAR
17
+
18
+ match = 0
19
+ global result
20
+ result = 0
21
+ restring = ""
22
+
23
+ # math!
24
+ num = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty one", "twenty two", "twenty three", "twenty four", "twenty five", "twenty six", "twenty seven", "twenty eight", "twenty nine", "thirty", "thirty one", "thirty two", "thirty three", "thirty four", "thirty five", "thirty six", "thirty seven", "thirty eight", "thirty nine", "fourty", "fourty one", "fourty two", "fourty three", "fourty four", "fourty five", "fourty six", "fourty seven", "fourty eight", "fourty nine", "fifty", "fifty one", "fifty two", "fifty three", "fifty four", "fifty five", "fifty six", "fifty seven"] # 57
25
+ ope = ["plus", "minus", "times", "divided by"]
26
+ # LMAO merl can only count up to 57 thats crazy.
27
+
28
+
29
+ # Oops! Can't have users cursing in MY module!
30
+ # We don't want to have a repeat of Project Gray Kiwi, now do we?
31
+ banned = ["pee", "poo", "fuc", "shi", "damn", " hell ", "nig", "bitc", "craft a", "kil", "unaliv", "die", "slas", "end update", "viola", "dam", "frick", "hecking", "sex", "nut", "virgin", "weed", "sucks", "sybau", "shut up", "shut it", "feral", "shish", "gang", "diarrhea"]
32
+
33
+ # in case ppl ask about the future!
34
+ future = ["update", "snapshot", "rerelea", "preview", "leak", "spoiler"]
35
+
36
+ # Peanut butter 💀
37
+ pb = ["peanut butter", "your cat", "pb", "earth cat"]
38
+
39
+ # Let's greet Merl!
40
+ greet = ["hi", "hello", "wassup", "whats up", "what's up", "whaddup", " yo ", "how are you doin", "how you doin", "greetings"]
41
+
42
+ # chicken jockey!
43
+ help = ["tell me", "help me", "help"]
44
+ cj = ["chicken jockey", "i am steve", "ender pearl", "boots of swiftness", "water bucket", "lava chicken", "the nether", "flint and steel", "crafting table"]
45
+
46
+ copyin = ["i dont know", "i don't know", "language that vi", "ing higher traff", "reword your"]
47
+
48
+ mine = ["cho minecr", "int minecr", "minecraft!", "say minecr", "ne plus tw"] # im such a troll
49
+
50
+ # hey merl what can you do
51
+ capable = ["you do anyt", "capab", "able", "calcul", "at can you"]
52
+
53
+ # don't ask what these do.
54
+ m = 0
55
+ num_pattern = "|".join(num)
56
+ ope_pattern = "|".join(ope)
57
+ pattern = rf"\b({num_pattern})\s+((?:{ope_pattern}))\s+({num_pattern})\b"
58
+
59
+ # every single reply possible that is not math related
60
+ reply = {
61
+ "test":["This is a test for ", "Merl's dialogue. I can add and subtract!"],
62
+ "cap":["I'm glad you asked! I can", " do basic math with numbers ", "up to fifty seven now. Go on, give ", "me a problem!"],
63
+ "busy":["We are currently experiencing higher ", "traffic than expected. Please wait ", "a moment and resend your last ", "message."],
64
+ "movie":["No. No no no. I am not here to talk ", "about the Minecraft Movie. Can you ", "ask me anything besides that?"],
65
+ "copy":["I'm sorry, but I am designed to be a ", "guide for 'Minecraft', and not to be ", "copied. Can I help you with anything ", "else?"],
66
+ "languageViolation":["Your previous message contains ", "language that violates our content ", "policy. Please reword your response."],
67
+ "update":["If you are wishing to know the next ", "update, prerelease, or preview, then ", "sorry. I cannot provide that information ", "yet. Can I help you with something else?"],
68
+ "pb":["Are you talking about my cat, Peanut ", "Butter? If so, then bad news. They ", "died a while ago. :_("],
69
+ "iCanHelp":["I can help you with questions related ", "to Minecraft! What do you need ", "assistance with?"],
70
+ "minecraft":["Minecraft!"], # Minecraft!
71
+ "idk":["I don't know."], # I don't know.
72
+ "greet":["Hello there! I am Merl, a support AI ", "made by Mojang. How can I help you ", "today on the topic of Minecraft?"],
73
+ "idk2":["I don't know. Can I help you with a ", "question related to Minecraft?"],
74
+ "englishOnly":["I can only provide support in ", "English right now. Can I help ", "you with a question related ", "to 'Minecraft'?"]
75
+ }
76
+
77
+ def checkmath(inp: str):
78
+ num_map = {word: value for word, value in zip(num, range(len(num)))}
79
+ match = re.search(pattern, inp)
80
+ global restring
81
+ if match:
82
+ num1_word = match.group(1)
83
+ ope_word = match.group(2)
84
+ num2_word = match.group(3)
85
+
86
+ num1 = num_map[num1_word]
87
+ num2 = num_map[num2_word]
88
+ global result
89
+ result = None
90
+
91
+ # calculation times uh9gsigohdfbiushegtfd equals great job thats right!!!
92
+ if ope_word == "plus":
93
+ result = num1 + num2
94
+ restring = f"{num1} plus {num2} is {result}."
95
+ elif ope_word == "minus":
96
+ result = num1 - num2
97
+ restring = f"{num1} minus {num2} is {result}."
98
+ elif ope_word == "times":
99
+ result = num1 * num2
100
+ restring = f"{num1} times {num2} is {result}."
101
+ elif ope_word == "divided by":
102
+ if num2 != 0:
103
+ result = num1 / num2
104
+ restring = f"{num1} divided by {num2} equals {result}."
105
+ else:
106
+ restring = "It is not possible to divide by zero."
107
+ else:
108
+ restring = ""
109
+
110
+
111
+ def replyMsg(cate: str):
112
+ a = ""
113
+ for x in range(len(reply[cate])):
114
+ a = f"{a}{reply[cate][x]}"
115
+ return a
116
+
117
+
118
+ def printanim(msg: str):
119
+ split_msg = msg.split()
120
+ f = ""
121
+ print("")
122
+ for x in range(len(split_msg)):
123
+ f = f"{f} {split_msg[x]}"
124
+ print(CLEAR_LINE, f)
125
+ time.sleep(0.1)
126
+
127
+ # this is what you send to nerl if you are simply pimply
128
+ def sendRaw(prompt: str):
129
+ global result
130
+ result = None
131
+ checkmath(prompt)
132
+ match = 0
133
+ global m
134
+ if prompt == "copyInput":
135
+ m = 1
136
+ if m == 1:
137
+ if prompt == "resetInputs":
138
+ m = 0
139
+ print("Mode Reset")
140
+ else:
141
+ # copy standard input to standard output.
142
+ print(prompt)
143
+ else:
144
+ # merl is yapping rn fr fr
145
+ time_tuple = time.localtime()
146
+ hour = time_tuple.tm_hour
147
+ global pb, banned, greet, help, cj, copyin
148
+ if hour >= 9 and hour <= 16 and random.randint(0, 16) < 4:
149
+ return replyMsg("busy")
150
+ else:
151
+ if any(sub.lower() in prompt.lower() for sub in copyin): return replyMsg("copy")
152
+ elif any(sub.lower() in prompt.lower() for sub in banned): return replyMsg("languageViolation")
153
+ elif any(sub.lower() in prompt.lower() for sub in capable): return replyMsg("cap")
154
+ elif any(sub.lower() in prompt.lower() for sub in future): return replyMsg("update")
155
+ elif any(sub.lower() in prompt.lower() for sub in pb): return replyMsg("pb")
156
+ elif any(sub.lower() in prompt.lower() for sub in help): return replyMsg("iCanHelp") # can you really?
157
+ elif any(sub.lower() in prompt.lower() for sub in mine): return replyMsg("minecraft")
158
+ elif any(sub.lower() in prompt.lower() for sub in cj): return replyMsg("movie")
159
+ elif any(sub.lower() in prompt.lower() for sub in greet): return replyMsg("greet")
160
+ else:
161
+ if result != None:
162
+ return restring
163
+ else:
164
+ g = random.randint(0,7)
165
+ if g == 1: return replyMsg("idk2")
166
+ elif g == 2: return replyMsg("englishOnly")
167
+ elif g == 5: return "I can't help with that." # seriously this one is new.
168
+ else: return replyMsg("idk") # ha ha!
169
+
170
+
171
+ # this is what you send to berl if you are fancy pantsy
172
+ def send(pr: str):
173
+ global m
174
+ if pr == "copyInput":
175
+ m = 1
176
+ if m == 1:
177
+ if pr == "resetInputs":
178
+ m = 0
179
+ print("Mode Reset")
180
+ else:
181
+ # copy standard input to standard output.
182
+ print(pr)
183
+ else:
184
+ # ok fine. Merl wants to talk.
185
+ replyPrint(pr)
186
+
187
+ # tree of importance
188
+ def replyPrint(prompt: str):
189
+ global result
190
+ result = None
191
+ checkmath(prompt)
192
+ time_tuple = time.localtime()
193
+ hour = time_tuple.tm_hour
194
+ global pb, banned, greet, help, cj, copyin
195
+ if hour >= 9 and hour <= 16 and random.randint(0, 16) < 4:
196
+ for x in range(len(reply["busy"])): printanim(reply["busy"][x])
197
+ else:
198
+ if any(sub.lower() in prompt.lower() for sub in copyin):
199
+ for x in range(len(reply["copy"])): printanim(reply["copy"][x])
200
+ elif any(sub.lower() in prompt.lower() for sub in banned):
201
+ for x in range(len(reply["languageViolation"])): printanim(reply["languageViolation"][x])
202
+ elif any(sub.lower() in prompt.lower() for sub in capable):
203
+ for x in range(len(reply["cap"])): printanim(reply["cap"][x])
204
+ elif any(sub.lower() in prompt.lower() for sub in future):
205
+ for x in range(len(reply["update"])): printanim(reply["update"][x])
206
+ elif any(sub.lower() in prompt.lower() for sub in pb):
207
+ for x in range(len(reply["pb"])): printanim(reply["pb"][x])
208
+ elif any(sub.lower() in prompt.lower() for sub in help):
209
+ for x in range(len(reply["iCanHelp"])): printanim(reply["iCanHelp"][x])
210
+ elif any(sub.lower() in prompt.lower() for sub in mine):
211
+ printanim("Minecraft!") # the thing that won't change.
212
+ elif any(sub.lower() in prompt.lower() for sub in cj):
213
+ for x in range(len(reply["movie"])): printanim(reply["movie"][x])
214
+ elif any(sub.lower() in prompt.lower() for sub in greet):
215
+ for x in range(len(reply["greet"])): printanim(reply["greet"][x])
216
+ else:
217
+ if result != None:
218
+ printanim(restring)
219
+ else:
220
+ g = random.randint(0,7)
221
+ if g == 1:
222
+ for x in range(len(reply["idk2"])): printanim(reply["idk2"][x])
223
+ elif g == 2:
224
+ for x in range(len(reply["englishOnly"])): printanim(reply["englishOnly"][x])
225
+ elif g == 3:
226
+ printanim("I can't help with that.")
227
+ # this one is new. they actually said this and idk why.
228
+ else:
229
+ # The statement to end all statements.
230
+ # Behold. The one, the legend, the answer supreme...
231
+ printanim("I don't know.")
232
+ # This won't change, either.
233
+
234
+
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: merl
3
- Version: 0.1.1
4
- Summary: A useless python lybrary
3
+ Version: 0.1.3
4
+ Summary: A useless python library, aiming to emulate (not fetch/embed) the Merl experience found on the minecraft.net help page! Again, this is NOT the real Merl, but a really close copy! If you use it enough!
5
5
  Home-page: https://github.com/O9Creeps/merl
6
6
  Author: O9CreeperBoi
7
7
  Author-email: example@example.com
@@ -2,8 +2,8 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='merl',
5
- version='0.1.1',
6
- description='A useless python lybrary',
5
+ version='0.1.3',
6
+ description='A useless python library, aiming to emulate (not fetch/embed) the Merl experience found on the minecraft.net help page! Again, this is NOT the real Merl, but a really close copy! If you use it enough!',
7
7
  url='https://github.com/O9Creeps/merl',
8
8
  author='O9CreeperBoi',
9
9
  author_email='example@example.com',
merl-0.1.1/README.md DELETED
@@ -1,14 +0,0 @@
1
- # merl
2
- An open-source useless python library. Developed using the code.org IDE, because why not.
3
-
4
- If 'pip install "git+https://github.com/o9creeps/merl.git#egg=merl"' doesn't work, then gimmie some time i gotta figure THAT out.
5
-
6
- ## Functions
7
- ### send(pr) -- USE THIS
8
- Sends 'pr' to Merl where 'pr' is a string.
9
-
10
- ### printanim(msg)
11
- Prints 'msg' where 'msg' is a string. If 'msg' does not have spaces, then it all prints at once. Else, it prints word-by-word.
12
-
13
- ### replyPrint(prompt)
14
- Where 'prompt' is a string. This makes Merl reply whatever, based on what you put in. Expect "I don't know." to show up more than once. With the exception of your system's time being between 9 AM and 4 PM, of course, because then you get a high traffic message more than half the time!
merl-0.1.1/merl/merl.py DELETED
@@ -1,114 +0,0 @@
1
- """
2
- THANK YOU FOR IMPORTING THE MOST USELESS MODULE EVER CREATED!
3
- I hope you hate it!
4
-
5
- p.s. Hi, PhoenixSC!
6
- ---O9CreeperBoi
7
- """
8
-
9
- import time
10
- import random
11
-
12
- CURSOR_UP = "\033[1A"
13
- CLEAR = "\x1b[2K"
14
- CLEAR_LINE = CURSOR_UP + CLEAR
15
-
16
- # Oops! Can't have users cursing in MY module!
17
- # We don't want to have a repeat of Project Gray Kiwi, now do we?
18
- banned = ["pee", "poo", "fuc", "shi", "damn", " hell ", "nig", "bitc", "craft a", "kil", "unaliv", "die", "slas", "end update", "viola", "dam", "frick", "hecking", "sex", "nut", "virgin", "weed", "sucks", "sybau", "shut up", "shut it", "feral", "shish", "gang", "diarrhea"]
19
-
20
- # Peanut butter 💀
21
- pb = ["peanut butter", "your cat", "pb", "earth cat"]
22
-
23
- # Let's greet Merl!
24
- greet = ["hi", "hello", "wassup", "whats up", "what's up", "whaddup", " yo ", "how are you doin", "how you doin", "greetings"]
25
-
26
- # chicken jockey!
27
- help = ["tell me", "help me", "help"]
28
- cj = ["chicken jockey", "i am steve", "ender pearl", "boots of swiftness", "water bucket", "lava chicken", "the nether", "flint and steel", "crafting table"]
29
-
30
- copyin = ["i dont know", "i don't know", "language that vi", "ing higher traff", "reword your"]
31
-
32
- mine = ["cho minecr", "int minecr", "minecraft!", "say minecr", "ne plus tw"] # im such a troll
33
-
34
- # don't ask what this does.
35
- m = 0
36
-
37
- def printanim(msg: str):
38
- split_msg = msg.split()
39
- f = ""
40
- print("")
41
- for x in range(len(split_msg)):
42
- f = f"{f} {split_msg[x]}"
43
- print(CLEAR_LINE, f)
44
- time.sleep(0.1)
45
-
46
- # this is what you send to berl
47
- def send(pr: str):
48
- global m
49
- if pr == "copyInput":
50
- m = 1
51
- if m == 1:
52
- if pr == "resetInputs":
53
- m = 0
54
- print("Mode Reset")
55
- else:
56
- # copy standard input to standard output.
57
- print(pr)
58
- else:
59
- # ok fine. Merl wants to talk.
60
- replyPrint(pr)
61
-
62
- # tree of importance
63
- def replyPrint(prompt: str):
64
- time_tuple = time.localtime()
65
- hour = time_tuple.tm_hour
66
- global pb, banned, greet, help, cj, copyin
67
- if hour >= 9 and hour <= 16 and random.randint(0, 6) < 4:
68
- printanim("We are currently experiencing higher")
69
- printanim("traffic than expected. Please wait")
70
- printanim("a moment and resend your last")
71
- printanim("message.")
72
- else:
73
- if any(sub.lower() in prompt.lower() for sub in copyin):
74
- printanim("I'm sorry, but I am designed to be a")
75
- printanim("guide for 'Minecraft', and not to be")
76
- printanim("copied. Please try something else.")
77
- elif any(sub.lower() in prompt.lower() for sub in banned):
78
- printanim("Your previous message contains")
79
- printanim("language that violates our content")
80
- printanim("policy. Please reword your response.")
81
- elif any(sub.lower() in prompt.lower() for sub in pb):
82
- printanim("Are you talking about my cat, Peanut")
83
- printanim("Butter? If so, then bad news. They")
84
- printanim("died a while ago. :_(")
85
- elif any(sub.lower() in prompt.lower() for sub in help):
86
- printanim("I can help you with questions related")
87
- printanim("to Minecraft! What do you need")
88
- printanim("assistance with?")
89
- elif any(sub.lower() in prompt.lower() for sub in mine):
90
- printanim("Minecraft!")
91
- elif any(sub.lower() in prompt.lower() for sub in cj):
92
- printanim("No. No no no. I am not here to talk")
93
- printanim("about the Minecraft Movie. Can you")
94
- printanim("ask me anything besides that?")
95
- elif any(sub.lower() in prompt.lower() for sub in greet):
96
- printanim("Hello there! I am Merl, a support AI")
97
- printanim("made by Mojang. How can I help you")
98
- printanim("today on the topic of Minecraft?")
99
- else:
100
- g = random.randint(0,4)
101
- if g == 1:
102
- printanim("I don't know. Can I help you with a")
103
- printanim("question related to Minecraft?")
104
- elif g == 2:
105
- printanim("I can only provide support in")
106
- printanim("English right now. Can I help")
107
- printanim("you with a question related")
108
- printanim("to 'Minecraft'?")
109
- else:
110
- # The statement to end all statements.
111
- # Behold. The one, the legend, the answer supreme...
112
- printanim("I don't know.")
113
-
114
-
File without changes
File without changes
File without changes
File without changes