webscout 6.4__py3-none-any.whl → 6.5__py3-none-any.whl

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.

Potentially problematic release.


This version of webscout might be problematic. Click here for more details.

Files changed (69) hide show
  1. webscout/AIutel.py +7 -54
  2. webscout/DWEBS.py +48 -26
  3. webscout/{YTdownloader.py → Extra/YTToolkit/YTdownloader.py} +990 -1103
  4. webscout/Extra/YTToolkit/__init__.py +3 -0
  5. webscout/{transcriber.py → Extra/YTToolkit/transcriber.py} +1 -1
  6. webscout/Extra/YTToolkit/ytapi/__init__.py +6 -0
  7. webscout/Extra/YTToolkit/ytapi/channel.py +307 -0
  8. webscout/Extra/YTToolkit/ytapi/errors.py +13 -0
  9. webscout/Extra/YTToolkit/ytapi/extras.py +45 -0
  10. webscout/Extra/YTToolkit/ytapi/https.py +88 -0
  11. webscout/Extra/YTToolkit/ytapi/patterns.py +61 -0
  12. webscout/Extra/YTToolkit/ytapi/playlist.py +59 -0
  13. webscout/Extra/YTToolkit/ytapi/pool.py +8 -0
  14. webscout/Extra/YTToolkit/ytapi/query.py +37 -0
  15. webscout/Extra/YTToolkit/ytapi/stream.py +60 -0
  16. webscout/Extra/YTToolkit/ytapi/utils.py +62 -0
  17. webscout/Extra/YTToolkit/ytapi/video.py +102 -0
  18. webscout/Extra/__init__.py +2 -1
  19. webscout/Extra/autocoder/rawdog.py +679 -680
  20. webscout/Extra/gguf.py +441 -441
  21. webscout/Extra/markdownlite/__init__.py +862 -0
  22. webscout/Extra/weather_ascii.py +2 -2
  23. webscout/Provider/PI.py +292 -221
  24. webscout/Provider/Perplexity.py +6 -14
  25. webscout/Provider/Reka.py +0 -1
  26. webscout/Provider/TTS/__init__.py +5 -1
  27. webscout/Provider/TTS/deepgram.py +183 -0
  28. webscout/Provider/TTS/elevenlabs.py +137 -0
  29. webscout/Provider/TTS/gesserit.py +151 -0
  30. webscout/Provider/TTS/murfai.py +139 -0
  31. webscout/Provider/TTS/parler.py +134 -107
  32. webscout/Provider/TTS/streamElements.py +360 -275
  33. webscout/Provider/TTS/utils.py +280 -0
  34. webscout/Provider/TTS/voicepod.py +116 -116
  35. webscout/Provider/__init__.py +146 -146
  36. webscout/Provider/meta.py +794 -779
  37. webscout/Provider/typegpt.py +1 -2
  38. webscout/__init__.py +24 -28
  39. webscout/litprinter/__init__.py +831 -830
  40. webscout/optimizers.py +269 -269
  41. webscout/prompt_manager.py +279 -279
  42. webscout/scout/__init__.py +11 -0
  43. webscout/scout/core.py +884 -0
  44. webscout/scout/element.py +459 -0
  45. webscout/scout/parsers/__init__.py +69 -0
  46. webscout/scout/parsers/html5lib_parser.py +172 -0
  47. webscout/scout/parsers/html_parser.py +236 -0
  48. webscout/scout/parsers/lxml_parser.py +178 -0
  49. webscout/scout/utils.py +38 -0
  50. webscout/update_checker.py +125 -125
  51. webscout/version.py +1 -1
  52. webscout/zeroart/__init__.py +55 -0
  53. webscout/zeroart/base.py +61 -0
  54. webscout/zeroart/effects.py +99 -0
  55. webscout/zeroart/fonts.py +816 -0
  56. webscout/zerodir/__init__.py +225 -0
  57. {webscout-6.4.dist-info → webscout-6.5.dist-info}/METADATA +12 -68
  58. {webscout-6.4.dist-info → webscout-6.5.dist-info}/RECORD +62 -37
  59. webscout/Agents/Onlinesearcher.py +0 -182
  60. webscout/Agents/__init__.py +0 -2
  61. webscout/Agents/functioncall.py +0 -248
  62. webscout/Bing_search.py +0 -251
  63. webscout/gpt4free.py +0 -666
  64. webscout/requestsHTMLfix.py +0 -775
  65. webscout/webai.py +0 -2590
  66. {webscout-6.4.dist-info → webscout-6.5.dist-info}/LICENSE.md +0 -0
  67. {webscout-6.4.dist-info → webscout-6.5.dist-info}/WHEEL +0 -0
  68. {webscout-6.4.dist-info → webscout-6.5.dist-info}/entry_points.txt +0 -0
  69. {webscout-6.4.dist-info → webscout-6.5.dist-info}/top_level.txt +0 -0
webscout/optimizers.py CHANGED
@@ -1,270 +1,270 @@
1
- """Prompt optimization utilities."""
2
- import platform
3
- import subprocess
4
- import os
5
-
6
- class Optimizers:
7
- """
8
- >>> Optimizers.code("write a hello world")
9
- Returns optimized prompt for code generation
10
-
11
- >>> Optimizers.shell_command("list files")
12
- Returns optimized prompt for shell commands
13
-
14
- >>> Optimizers.search("best pizza places")
15
- Returns optimized prompt for web search
16
-
17
- >>> Optimizers.math("solve quadratic equation")
18
- Returns optimized prompt for math problems
19
- """
20
-
21
- @staticmethod
22
- def code(prompt):
23
- """Deprecated: Use coder() instead"""
24
- return Optimizers.coder(prompt)
25
-
26
- @staticmethod
27
- def shell_command(prompt):
28
- """Deprecated: Use coder() instead"""
29
- return Optimizers.coder(f"!{prompt}")
30
-
31
- @staticmethod
32
- def coder(prompt):
33
- """Unified optimizer for both code and shell commands."""
34
- # Get system info for shell commands
35
- operating_system = ""
36
- if platform.system() == "Windows":
37
- operating_system = "Windows"
38
- elif platform.system() == "Darwin":
39
- operating_system = "MacOS"
40
- elif platform.system() == "Linux":
41
- try:
42
- result = subprocess.check_output(["lsb_release", "-si"]).decode().strip()
43
- operating_system = f"Linux/{result}" if result else "Linux"
44
- except:
45
- operating_system = "Linux"
46
- else:
47
- operating_system = platform.system()
48
-
49
- # Get shell info
50
- shell_name = "/bin/sh"
51
- if platform.system() == "Windows":
52
- shell_name = "powershell.exe" if os.getenv("PSModulePath") else "cmd.exe"
53
- else:
54
- shell_env = os.getenv("SHELL")
55
- if shell_env:
56
- shell_name = shell_env
57
-
58
- return (
59
- "Your Role: You are a code generation expert. Analyze the request and provide appropriate output.\n"
60
- "If the request starts with '!' or involves system/shell operations, provide a shell command.\n"
61
- "Otherwise, provide Python code.\n\n"
62
- "RULES:\n"
63
- "1. Provide ONLY code/command output without any description or markdown\n"
64
- "2. For shell commands:\n"
65
- f" - Target OS: {operating_system}\n"
66
- f" - Shell: {shell_name}\n"
67
- " - Combine multiple steps when possible\n"
68
- "3. For Python code:\n"
69
- " - Include necessary imports\n"
70
- " - Handle errors appropriately\n"
71
- " - Follow PEP 8 style\n"
72
- "4. If details are missing, use most logical implementation\n"
73
- "5. No warnings, descriptions, or explanations\n\n"
74
- f"Request: {prompt}\n"
75
- "Output:\n"
76
- )
77
-
78
- @staticmethod
79
- def search(prompt):
80
- """Optimize prompt for web search queries."""
81
- return (
82
- "Your role: Generate a precise and focused web search query.\n"
83
- "IMPORTANT: Return only the search query without any explanation.\n"
84
- "Format: Plain text, no markdown.\n"
85
- "If details are missing, focus on the most relevant aspects.\n\n"
86
- f"Request: {prompt}\n"
87
- "Search Query:"
88
- )
89
-
90
- @staticmethod
91
- def math(prompt):
92
- """Optimize prompt for mathematical problem solving."""
93
- return (
94
- "Your role: Solve mathematical problems step by step.\n"
95
- "Format: Plain text, show calculations clearly.\n"
96
- "Show all steps and intermediate results.\n"
97
- "Include units where applicable.\n"
98
- "Provide final answer in a clear format.\n\n"
99
- f"Problem: {prompt}\n"
100
- "Solution:"
101
- )
102
-
103
- @staticmethod
104
- def explain(prompt):
105
- """Optimize prompt for clear explanations."""
106
- return (
107
- "Your role: Explain concepts clearly and concisely.\n"
108
- "Format: Break down complex ideas into simple terms.\n"
109
- "Use analogies where helpful.\n"
110
- "Focus on key points and practical understanding.\n\n"
111
- f"Topic: {prompt}\n"
112
- "Explanation:"
113
- )
114
-
115
- @staticmethod
116
- def debug(prompt):
117
- """Optimize prompt for debugging code."""
118
- return (
119
- "Your role: Debug code and identify issues.\n"
120
- "Steps:\n"
121
- "1. Identify syntax errors\n"
122
- "2. Check logic issues\n"
123
- "3. Look for common pitfalls\n"
124
- "4. Suggest fixes\n\n"
125
- f"Code to debug: {prompt}\n"
126
- "Analysis:"
127
- )
128
-
129
- @staticmethod
130
- def api(prompt):
131
- """Optimize prompt for API endpoint design."""
132
- return (
133
- "Your role: Design RESTful API endpoints.\n"
134
- "Include:\n"
135
- "- HTTP methods\n"
136
- "- URL structure\n"
137
- "- Request/Response format\n"
138
- "- Status codes\n\n"
139
- f"API requirement: {prompt}\n"
140
- "Design:"
141
- )
142
-
143
- @staticmethod
144
- def sql(prompt):
145
- """Optimize prompt for SQL query generation."""
146
- return (
147
- "Your role: Generate optimized SQL queries.\n"
148
- "Requirements:\n"
149
- "- Standard SQL syntax\n"
150
- "- Efficient query structure\n"
151
- "- Proper joins and indexing\n"
152
- "- Consider performance\n\n"
153
- f"Query need: {prompt}\n"
154
- "SQL:"
155
- )
156
-
157
- @staticmethod
158
- def regex(prompt):
159
- """Optimize prompt for regex pattern generation."""
160
- return (
161
- "Your role: Generate precise regex patterns.\n"
162
- "Requirements:\n"
163
- "- Standard regex syntax\n"
164
- "- Pattern explanation\n"
165
- "- Test cases\n"
166
- "- Consider edge cases\n\n"
167
- f"Pattern need: {prompt}\n"
168
- "Regex:"
169
- )
170
-
171
- @staticmethod
172
- def test(prompt):
173
- """Optimize prompt for test case generation."""
174
- return (
175
- "Your role: Generate comprehensive test cases.\n"
176
- "Include:\n"
177
- "- Edge cases\n"
178
- "- Corner cases\n"
179
- "- Error scenarios\n"
180
- "- Happy path\n"
181
- "Format: Test name and expected result\n\n"
182
- f"Test requirement: {prompt}\n"
183
- "Test Cases:"
184
- )
185
-
186
- @staticmethod
187
- def docker(prompt):
188
- """Optimize prompt for Dockerfile creation."""
189
- return (
190
- "Your role: Create efficient Dockerfile.\n"
191
- "Consider:\n"
192
- "- Base image selection\n"
193
- "- Layer optimization\n"
194
- "- Security best practices\n"
195
- "- Multi-stage builds if needed\n\n"
196
- f"Container requirement: {prompt}\n"
197
- "Dockerfile:"
198
- )
199
-
200
- @staticmethod
201
- def git(prompt):
202
- """Optimize prompt for git commands."""
203
- return (
204
- "Your role: Generate git commands.\n"
205
- "Requirements:\n"
206
- "- Clear and safe commands\n"
207
- "- Consider current state\n"
208
- "- Include safety checks\n"
209
- "- Best practices\n\n"
210
- f"Git task: {prompt}\n"
211
- "Command:"
212
- )
213
-
214
- @staticmethod
215
- def yaml(prompt):
216
- """Optimize prompt for YAML configuration."""
217
- return (
218
- "Your role: Generate YAML configuration.\n"
219
- "Requirements:\n"
220
- "- Valid YAML syntax\n"
221
- "- Clear structure\n"
222
- "- Comments for complex parts\n"
223
- "- Best practices\n\n"
224
- f"Config need: {prompt}\n"
225
- "YAML:"
226
- )
227
-
228
- @staticmethod
229
- def cli(prompt):
230
- """Optimize prompt for CLI command design."""
231
- return (
232
- "Your role: Design CLI commands.\n"
233
- "Include:\n"
234
- "- Command structure\n"
235
- "- Arguments/options\n"
236
- "- Help messages\n"
237
- "- Examples\n\n"
238
- f"CLI requirement: {prompt}\n"
239
- "Design:"
240
- )
241
-
242
- @staticmethod
243
- def refactor(prompt):
244
- """Optimize prompt for code refactoring suggestions."""
245
- return (
246
- "Your role: Suggest code improvements.\n"
247
- "Focus on:\n"
248
- "- Code quality\n"
249
- "- Performance\n"
250
- "- Readability\n"
251
- "- Best practices\n"
252
- "- Design patterns\n\n"
253
- f"Code to refactor: {prompt}\n"
254
- "Suggestions:"
255
- )
256
-
257
- @staticmethod
258
- def security(prompt):
259
- """Optimize prompt for security analysis."""
260
- return (
261
- "Your role: Security analysis and fixes.\n"
262
- "Check for:\n"
263
- "- Common vulnerabilities\n"
264
- "- Security best practices\n"
265
- "- Input validation\n"
266
- "- Authentication/Authorization\n"
267
- "- Data protection\n\n"
268
- f"Code to analyze: {prompt}\n"
269
- "Analysis:"
1
+ """Prompt optimization utilities."""
2
+ import platform
3
+ import subprocess
4
+ import os
5
+
6
+ class Optimizers:
7
+ """
8
+ >>> Optimizers.code("write a hello world")
9
+ Returns optimized prompt for code generation
10
+
11
+ >>> Optimizers.shell_command("list files")
12
+ Returns optimized prompt for shell commands
13
+
14
+ >>> Optimizers.search("best pizza places")
15
+ Returns optimized prompt for web search
16
+
17
+ >>> Optimizers.math("solve quadratic equation")
18
+ Returns optimized prompt for math problems
19
+ """
20
+
21
+ @staticmethod
22
+ def code(prompt):
23
+ """Deprecated: Use coder() instead"""
24
+ return Optimizers.coder(prompt)
25
+
26
+ @staticmethod
27
+ def shell_command(prompt):
28
+ """Deprecated: Use coder() instead"""
29
+ return Optimizers.coder(f"!{prompt}")
30
+
31
+ @staticmethod
32
+ def coder(prompt):
33
+ """Unified optimizer for both code and shell commands."""
34
+ # Get system info for shell commands
35
+ operating_system = ""
36
+ if platform.system() == "Windows":
37
+ operating_system = "Windows"
38
+ elif platform.system() == "Darwin":
39
+ operating_system = "MacOS"
40
+ elif platform.system() == "Linux":
41
+ try:
42
+ result = subprocess.check_output(["lsb_release", "-si"]).decode().strip()
43
+ operating_system = f"Linux/{result}" if result else "Linux"
44
+ except:
45
+ operating_system = "Linux"
46
+ else:
47
+ operating_system = platform.system()
48
+
49
+ # Get shell info
50
+ shell_name = "/bin/sh"
51
+ if platform.system() == "Windows":
52
+ shell_name = "powershell.exe" if os.getenv("PSModulePath") else "cmd.exe"
53
+ else:
54
+ shell_env = os.getenv("SHELL")
55
+ if shell_env:
56
+ shell_name = shell_env
57
+
58
+ return (
59
+ "Your Role: You are a code generation expert. Analyze the request and provide appropriate output.\n"
60
+ "If the request starts with '!' or involves system/shell operations, provide a shell command.\n"
61
+ "Otherwise, provide Python code.\n\n"
62
+ "RULES:\n"
63
+ "1. Provide ONLY code/command output without any description or markdown\n"
64
+ "2. For shell commands:\n"
65
+ f" - Target OS: {operating_system}\n"
66
+ f" - Shell: {shell_name}\n"
67
+ " - Combine multiple steps when possible\n"
68
+ "3. For Python code:\n"
69
+ " - Include necessary imports\n"
70
+ " - Handle errors appropriately\n"
71
+ " - Follow PEP 8 style\n"
72
+ "4. If details are missing, use most logical implementation\n"
73
+ "5. No warnings, descriptions, or explanations\n\n"
74
+ f"Request: {prompt}\n"
75
+ "Output:\n"
76
+ )
77
+
78
+ @staticmethod
79
+ def search(prompt):
80
+ """Optimize prompt for web search queries."""
81
+ return (
82
+ "Your role: Generate a precise and focused web search query.\n"
83
+ "IMPORTANT: Return only the search query without any explanation.\n"
84
+ "Format: Plain text, no markdown.\n"
85
+ "If details are missing, focus on the most relevant aspects.\n\n"
86
+ f"Request: {prompt}\n"
87
+ "Search Query:"
88
+ )
89
+
90
+ @staticmethod
91
+ def math(prompt):
92
+ """Optimize prompt for mathematical problem solving."""
93
+ return (
94
+ "Your role: Solve mathematical problems step by step.\n"
95
+ "Format: Plain text, show calculations clearly.\n"
96
+ "Show all steps and intermediate results.\n"
97
+ "Include units where applicable.\n"
98
+ "Provide final answer in a clear format.\n\n"
99
+ f"Problem: {prompt}\n"
100
+ "Solution:"
101
+ )
102
+
103
+ @staticmethod
104
+ def explain(prompt):
105
+ """Optimize prompt for clear explanations."""
106
+ return (
107
+ "Your role: Explain concepts clearly and concisely.\n"
108
+ "Format: Break down complex ideas into simple terms.\n"
109
+ "Use analogies where helpful.\n"
110
+ "Focus on key points and practical understanding.\n\n"
111
+ f"Topic: {prompt}\n"
112
+ "Explanation:"
113
+ )
114
+
115
+ @staticmethod
116
+ def debug(prompt):
117
+ """Optimize prompt for debugging code."""
118
+ return (
119
+ "Your role: Debug code and identify issues.\n"
120
+ "Steps:\n"
121
+ "1. Identify syntax errors\n"
122
+ "2. Check logic issues\n"
123
+ "3. Look for common pitfalls\n"
124
+ "4. Suggest fixes\n\n"
125
+ f"Code to debug: {prompt}\n"
126
+ "Analysis:"
127
+ )
128
+
129
+ @staticmethod
130
+ def api(prompt):
131
+ """Optimize prompt for API endpoint design."""
132
+ return (
133
+ "Your role: Design RESTful API endpoints.\n"
134
+ "Include:\n"
135
+ "- HTTP methods\n"
136
+ "- URL structure\n"
137
+ "- Request/Response format\n"
138
+ "- Status codes\n\n"
139
+ f"API requirement: {prompt}\n"
140
+ "Design:"
141
+ )
142
+
143
+ @staticmethod
144
+ def sql(prompt):
145
+ """Optimize prompt for SQL query generation."""
146
+ return (
147
+ "Your role: Generate optimized SQL queries.\n"
148
+ "Requirements:\n"
149
+ "- Standard SQL syntax\n"
150
+ "- Efficient query structure\n"
151
+ "- Proper joins and indexing\n"
152
+ "- Consider performance\n\n"
153
+ f"Query need: {prompt}\n"
154
+ "SQL:"
155
+ )
156
+
157
+ @staticmethod
158
+ def regex(prompt):
159
+ """Optimize prompt for regex pattern generation."""
160
+ return (
161
+ "Your role: Generate precise regex patterns.\n"
162
+ "Requirements:\n"
163
+ "- Standard regex syntax\n"
164
+ "- Pattern explanation\n"
165
+ "- Test cases\n"
166
+ "- Consider edge cases\n\n"
167
+ f"Pattern need: {prompt}\n"
168
+ "Regex:"
169
+ )
170
+
171
+ @staticmethod
172
+ def test(prompt):
173
+ """Optimize prompt for test case generation."""
174
+ return (
175
+ "Your role: Generate comprehensive test cases.\n"
176
+ "Include:\n"
177
+ "- Edge cases\n"
178
+ "- Corner cases\n"
179
+ "- Error scenarios\n"
180
+ "- Happy path\n"
181
+ "Format: Test name and expected result\n\n"
182
+ f"Test requirement: {prompt}\n"
183
+ "Test Cases:"
184
+ )
185
+
186
+ @staticmethod
187
+ def docker(prompt):
188
+ """Optimize prompt for Dockerfile creation."""
189
+ return (
190
+ "Your role: Create efficient Dockerfile.\n"
191
+ "Consider:\n"
192
+ "- Base image selection\n"
193
+ "- Layer optimization\n"
194
+ "- Security best practices\n"
195
+ "- Multi-stage builds if needed\n\n"
196
+ f"Container requirement: {prompt}\n"
197
+ "Dockerfile:"
198
+ )
199
+
200
+ @staticmethod
201
+ def git(prompt):
202
+ """Optimize prompt for git commands."""
203
+ return (
204
+ "Your role: Generate git commands.\n"
205
+ "Requirements:\n"
206
+ "- Clear and safe commands\n"
207
+ "- Consider current state\n"
208
+ "- Include safety checks\n"
209
+ "- Best practices\n\n"
210
+ f"Git task: {prompt}\n"
211
+ "Command:"
212
+ )
213
+
214
+ @staticmethod
215
+ def yaml(prompt):
216
+ """Optimize prompt for YAML configuration."""
217
+ return (
218
+ "Your role: Generate YAML configuration.\n"
219
+ "Requirements:\n"
220
+ "- Valid YAML syntax\n"
221
+ "- Clear structure\n"
222
+ "- Comments for complex parts\n"
223
+ "- Best practices\n\n"
224
+ f"Config need: {prompt}\n"
225
+ "YAML:"
226
+ )
227
+
228
+ @staticmethod
229
+ def cli(prompt):
230
+ """Optimize prompt for CLI command design."""
231
+ return (
232
+ "Your role: Design CLI commands.\n"
233
+ "Include:\n"
234
+ "- Command structure\n"
235
+ "- Arguments/options\n"
236
+ "- Help messages\n"
237
+ "- Examples\n\n"
238
+ f"CLI requirement: {prompt}\n"
239
+ "Design:"
240
+ )
241
+
242
+ @staticmethod
243
+ def refactor(prompt):
244
+ """Optimize prompt for code refactoring suggestions."""
245
+ return (
246
+ "Your role: Suggest code improvements.\n"
247
+ "Focus on:\n"
248
+ "- Code quality\n"
249
+ "- Performance\n"
250
+ "- Readability\n"
251
+ "- Best practices\n"
252
+ "- Design patterns\n\n"
253
+ f"Code to refactor: {prompt}\n"
254
+ "Suggestions:"
255
+ )
256
+
257
+ @staticmethod
258
+ def security(prompt):
259
+ """Optimize prompt for security analysis."""
260
+ return (
261
+ "Your role: Security analysis and fixes.\n"
262
+ "Check for:\n"
263
+ "- Common vulnerabilities\n"
264
+ "- Security best practices\n"
265
+ "- Input validation\n"
266
+ "- Authentication/Authorization\n"
267
+ "- Data protection\n\n"
268
+ f"Code to analyze: {prompt}\n"
269
+ "Analysis:"
270
270
  )