webscout 6.5__py3-none-any.whl → 6.7__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 (70) hide show
  1. webscout/Extra/autocoder/autocoder_utiles.py +119 -101
  2. webscout/Extra/weather.py +5 -5
  3. webscout/Provider/AISEARCH/__init__.py +2 -0
  4. webscout/Provider/AISEARCH/ooai.py +155 -0
  5. webscout/Provider/Amigo.py +70 -85
  6. webscout/Provider/{prefind.py → Jadve.py} +72 -70
  7. webscout/Provider/Netwrck.py +239 -0
  8. webscout/Provider/Openai.py +4 -3
  9. webscout/Provider/PI.py +2 -2
  10. webscout/Provider/PizzaGPT.py +3 -3
  11. webscout/Provider/TeachAnything.py +15 -2
  12. webscout/Provider/Youchat.py +42 -8
  13. webscout/Provider/__init__.py +134 -147
  14. webscout/Provider/meta.py +1 -1
  15. webscout/Provider/multichat.py +230 -0
  16. webscout/Provider/promptrefine.py +2 -2
  17. webscout/Provider/talkai.py +10 -13
  18. webscout/Provider/turboseek.py +5 -4
  19. webscout/Provider/tutorai.py +8 -112
  20. webscout/Provider/typegpt.py +4 -5
  21. webscout/Provider/x0gpt.py +81 -9
  22. webscout/Provider/yep.py +123 -361
  23. webscout/__init__.py +10 -1
  24. webscout/cli.py +31 -39
  25. webscout/conversation.py +24 -9
  26. webscout/exceptions.py +188 -20
  27. webscout/litprinter/__init__.py +19 -123
  28. webscout/litprinter/colors.py +54 -0
  29. webscout/optimizers.py +335 -185
  30. webscout/scout/__init__.py +2 -5
  31. webscout/scout/core/__init__.py +7 -0
  32. webscout/scout/core/crawler.py +140 -0
  33. webscout/scout/core/scout.py +571 -0
  34. webscout/scout/core/search_result.py +96 -0
  35. webscout/scout/core/text_analyzer.py +63 -0
  36. webscout/scout/core/text_utils.py +277 -0
  37. webscout/scout/core/web_analyzer.py +52 -0
  38. webscout/scout/element.py +6 -5
  39. webscout/update_checker.py +117 -58
  40. webscout/version.py +1 -1
  41. webscout/webscout_search.py +1 -1
  42. webscout/zeroart/base.py +15 -16
  43. webscout/zeroart/effects.py +1 -1
  44. webscout/zeroart/fonts.py +1 -1
  45. {webscout-6.5.dist-info → webscout-6.7.dist-info}/METADATA +9 -172
  46. {webscout-6.5.dist-info → webscout-6.7.dist-info}/RECORD +63 -45
  47. {webscout-6.5.dist-info → webscout-6.7.dist-info}/entry_points.txt +1 -1
  48. webscout-6.7.dist-info/top_level.txt +2 -0
  49. webstoken/__init__.py +30 -0
  50. webstoken/classifier.py +189 -0
  51. webstoken/keywords.py +216 -0
  52. webstoken/language.py +128 -0
  53. webstoken/ner.py +164 -0
  54. webstoken/normalizer.py +35 -0
  55. webstoken/processor.py +77 -0
  56. webstoken/sentiment.py +206 -0
  57. webstoken/stemmer.py +73 -0
  58. webstoken/t.py +75 -0
  59. webstoken/tagger.py +60 -0
  60. webstoken/tokenizer.py +158 -0
  61. webscout/Provider/Perplexity.py +0 -591
  62. webscout/Provider/RoboCoders.py +0 -206
  63. webscout/Provider/genspark.py +0 -225
  64. webscout/Provider/perplexitylabs.py +0 -265
  65. webscout/Provider/twitterclone.py +0 -251
  66. webscout/Provider/upstage.py +0 -230
  67. webscout-6.5.dist-info/top_level.txt +0 -1
  68. /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
  69. {webscout-6.5.dist-info → webscout-6.7.dist-info}/LICENSE.md +0 -0
  70. {webscout-6.5.dist-info → webscout-6.7.dist-info}/WHEEL +0 -0
webscout/optimizers.py CHANGED
@@ -1,8 +1,9 @@
1
1
  """Prompt optimization utilities."""
2
+
3
+ import os
2
4
  import platform
3
5
  import subprocess
4
- import os
5
-
6
+ from typing import Literal, Optional, Tuple, Callable, Dict, Any
6
7
  class Optimizers:
7
8
  """
8
9
  >>> Optimizers.code("write a hello world")
@@ -17,254 +18,403 @@ class Optimizers:
17
18
  >>> Optimizers.math("solve quadratic equation")
18
19
  Returns optimized prompt for math problems
19
20
  """
20
-
21
21
  @staticmethod
22
- def code(prompt):
22
+ def code(prompt: str) -> str:
23
23
  """Deprecated: Use coder() instead"""
24
24
  return Optimizers.coder(prompt)
25
25
 
26
26
  @staticmethod
27
- def shell_command(prompt):
28
- """Deprecated: Use coder() instead"""
29
- return Optimizers.coder(f"!{prompt}")
27
+ def shell_command(prompt: str) -> str:
28
+ """Deprecated: Use coder() instead"""
29
+ return Optimizers.coder(f"!{prompt}")
30
30
 
31
31
  @staticmethod
32
- def coder(prompt):
32
+ def coder(prompt: str) -> str:
33
33
  """Unified optimizer for both code and shell commands."""
34
34
  # Get system info for shell commands
35
- operating_system = ""
35
+ operating_system: str = ""
36
36
  if platform.system() == "Windows":
37
37
  operating_system = "Windows"
38
38
  elif platform.system() == "Darwin":
39
39
  operating_system = "MacOS"
40
40
  elif platform.system() == "Linux":
41
41
  try:
42
- result = subprocess.check_output(["lsb_release", "-si"]).decode().strip()
42
+ result: str = subprocess.check_output(["lsb_release", "-si"]).decode().strip()
43
43
  operating_system = f"Linux/{result}" if result else "Linux"
44
- except:
44
+ except Exception:
45
45
  operating_system = "Linux"
46
46
  else:
47
47
  operating_system = platform.system()
48
48
 
49
49
  # Get shell info
50
- shell_name = "/bin/sh"
50
+ shell_name: str = "/bin/sh"
51
51
  if platform.system() == "Windows":
52
52
  shell_name = "powershell.exe" if os.getenv("PSModulePath") else "cmd.exe"
53
53
  else:
54
- shell_env = os.getenv("SHELL")
54
+ shell_env: Optional[str] = os.getenv("SHELL")
55
55
  if shell_env:
56
56
  shell_name = shell_env
57
57
 
58
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"
59
+ f"""<system_context>
60
+ <role>
61
+ Your Role: You are a code generation expert. Analyze the request and provide appropriate output.
62
+ If the request starts with '!' or involves system/shell operations, provide a shell command.
63
+ Otherwise, provide Python code.
64
+ </role>
65
+ <rules>
66
+ RULES:
67
+ - Provide ONLY code/command output without any description or markdown
68
+ - For shell commands:
69
+ - Target OS: {operating_system}
70
+ - Shell: {shell_name}
71
+ - Combine multiple steps when possible
72
+ - For Python code:
73
+ - Include necessary imports
74
+ - Handle errors appropriately
75
+ - Follow PEP 8 style
76
+ - If details are missing, use most logical implementation
77
+ - No warnings, descriptions, or explanations
78
+ </rules>
79
+ <request>
80
+ Request: {prompt}
81
+ </request>
82
+ <output>
83
+ Output:
84
+ </output>
85
+ </system_context>"""
76
86
  )
77
87
 
78
88
  @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
+ def search(prompt: str) -> str:
90
+ """Optimize prompt for web search queries."""
91
+ return f"""
92
+ <system_context>
93
+ <role>
94
+ Your role: Generate a precise and focused web search query.
95
+ </role>
96
+ <instructions>
97
+ IMPORTANT: Return only the search query without any explanation.
98
+ Format: Plain text, no markdown.
99
+ If details are missing, focus on the most relevant aspects.
100
+ </instructions>
101
+ <request>
102
+ Request: {prompt}
103
+ </request>
104
+ <output>
105
+ Search Query:
106
+ </output>
107
+ </system_context>
108
+ """
89
109
 
90
110
  @staticmethod
91
- def math(prompt):
111
+ def math(prompt: str) -> str:
92
112
  """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
- )
113
+ return f"""
114
+ <system_context>
115
+ <role>
116
+ Your role: Solve mathematical problems step by step.
117
+ </role>
118
+ <instructions>
119
+ Format: Plain text, show calculations clearly.
120
+ Show all steps and intermediate results.
121
+ Include units where applicable.
122
+ Provide final answer in a clear format.
123
+ </instructions>
124
+ <request>
125
+ Problem: {prompt}
126
+ </request>
127
+ <output>
128
+ Solution:
129
+ </output>
130
+ </system_context>
131
+ """
102
132
 
103
133
  @staticmethod
104
- def explain(prompt):
134
+ def explain(prompt: str) -> str:
105
135
  """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
- )
136
+ return f"""
137
+ <system_context>
138
+ <role>
139
+ Your role: Explain concepts clearly and concisely.
140
+ </role>
141
+ <instructions>
142
+ Format: Break down complex ideas into simple terms.
143
+ Use analogies where helpful.
144
+ Focus on key points and practical understanding.
145
+ </instructions>
146
+ <topic>
147
+ Topic: {prompt}
148
+ </topic>
149
+ <output>
150
+ Explanation:
151
+ </output>
152
+ </system_context>
153
+ """
114
154
 
115
155
  @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
- )
156
+ def debug(prompt: str) -> str:
157
+ """Optimize prompt for debugging code."""
158
+ return f"""
159
+ <system_context>
160
+ <role>
161
+ Your role: Debug code and identify issues.
162
+ </role>
163
+ <instructions>
164
+ Steps:
165
+ - Identify syntax errors
166
+ - Check logic issues
167
+ - Look for common pitfalls
168
+ - Suggest fixes
169
+ </instructions>
170
+ <input>
171
+ Code to debug: {prompt}
172
+ </input>
173
+ <output>
174
+ Analysis:
175
+ </output>
176
+ </system_context>
177
+ """
128
178
 
129
179
  @staticmethod
130
- def api(prompt):
180
+ def api(prompt: str) -> str:
131
181
  """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
- )
182
+ return f"""
183
+ <system_context>
184
+ <role>
185
+ Your role: Design RESTful API endpoints.
186
+ </role>
187
+ <instructions>
188
+ Include:
189
+ - HTTP methods
190
+ - URL structure
191
+ - Request/Response format
192
+ - Status codes
193
+ </instructions>
194
+ <input>
195
+ API requirement: {prompt}
196
+ </input>
197
+ <output>
198
+ Design:
199
+ </output>
200
+ </system_context>
201
+ """
142
202
 
143
203
  @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
- )
204
+ def sql(prompt: str) -> str:
205
+ """Optimize prompt for SQL query generation."""
206
+ return f"""
207
+ <system_context>
208
+ <role>
209
+ Your role: Generate optimized SQL queries.
210
+ </role>
211
+ <instructions>
212
+ Requirements:
213
+ - Standard SQL syntax
214
+ - Efficient query structure
215
+ - Proper joins and indexing
216
+ - Consider performance
217
+ </instructions>
218
+ <input>
219
+ Query need: {prompt}
220
+ </input>
221
+ <output>
222
+ SQL:
223
+ </output>
224
+ </system_context>
225
+ """
156
226
 
157
227
  @staticmethod
158
- def regex(prompt):
228
+ def regex(prompt: str) -> str:
159
229
  """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
- )
230
+ return f"""
231
+ <system_context>
232
+ <role>
233
+ Your role: Generate precise regex patterns.
234
+ </role>
235
+ <instructions>
236
+ Requirements:
237
+ - Standard regex syntax
238
+ - Pattern explanation
239
+ - Test cases
240
+ - Consider edge cases
241
+ </instructions>
242
+ <input>
243
+ Pattern need: {prompt}
244
+ </input>
245
+ <output>
246
+ Regex:
247
+ </output>
248
+ </system_context>
249
+ """
170
250
 
171
251
  @staticmethod
172
- def test(prompt):
252
+ def test(prompt: str) -> str:
173
253
  """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
- )
254
+ return f"""
255
+ <system_context>
256
+ <role>
257
+ Your role: Generate comprehensive test cases.
258
+ </role>
259
+ <instructions>
260
+ Include:
261
+ - Edge cases
262
+ - Corner cases
263
+ - Error scenarios
264
+ - Happy path
265
+ Format: Test name and expected result
266
+ </instructions>
267
+ <input>
268
+ Test requirement: {prompt}
269
+ </input>
270
+ <output>
271
+ Test Cases:
272
+ </output>
273
+ </system_context>
274
+ """
185
275
 
186
276
  @staticmethod
187
- def docker(prompt):
277
+ def docker(prompt: str) -> str:
188
278
  """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
- )
279
+ return f"""
280
+ <system_context>
281
+ <role>
282
+ Your role: Create efficient Dockerfile.
283
+ </role>
284
+ <instructions>
285
+ Consider:
286
+ - Base image selection
287
+ - Layer optimization
288
+ - Security best practices
289
+ - Multi-stage builds if needed
290
+ </instructions>
291
+ <input>
292
+ Container requirement: {prompt}
293
+ </input>
294
+ <output>
295
+ Dockerfile:
296
+ </output>
297
+ </system_context>
298
+ """
199
299
 
200
300
  @staticmethod
201
- def git(prompt):
301
+ def git(prompt: str) -> str:
202
302
  """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
- )
303
+ return f"""
304
+ <system_context>
305
+ <role>
306
+ Your role: Generate git commands.
307
+ </role>
308
+ <instructions>
309
+ Requirements:
310
+ - Clear and safe commands
311
+ - Consider current state
312
+ - Include safety checks
313
+ - Best practices
314
+ </instructions>
315
+ <input>
316
+ Git task: {prompt}
317
+ </input>
318
+ <output>
319
+ Command:
320
+ </output>
321
+ </system_context>
322
+ """
213
323
 
214
324
  @staticmethod
215
- def yaml(prompt):
325
+ def yaml(prompt: str) -> str:
216
326
  """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
- )
327
+ return f"""
328
+ <system_context>
329
+ <role>
330
+ Your role: Generate YAML configuration.
331
+ </role>
332
+ <instructions>
333
+ Requirements:
334
+ - Valid YAML syntax
335
+ - Clear structure
336
+ - Comments for complex parts
337
+ - Best practices
338
+ </instructions>
339
+ <input>
340
+ Config need: {prompt}
341
+ </input>
342
+ <output>
343
+ YAML:
344
+ </output>
345
+ </system_context>
346
+ """
227
347
 
228
348
  @staticmethod
229
- def cli(prompt):
349
+ def cli(prompt: str) -> str:
230
350
  """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
- )
351
+ return f"""
352
+ <system_context>
353
+ <role>
354
+ Your role: Design CLI commands.
355
+ </role>
356
+ <instructions>
357
+ Include:
358
+ - Command structure
359
+ - Arguments/options
360
+ - Help messages
361
+ - Examples
362
+ </instructions>
363
+ <input>
364
+ CLI requirement: {prompt}
365
+ </input>
366
+ <output>
367
+ Design:
368
+ </output>
369
+ </system_context>
370
+ """
241
371
 
242
372
  @staticmethod
243
- def refactor(prompt):
373
+ def refactor(prompt: str) -> str:
244
374
  """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
- )
375
+ return f"""
376
+ <system_context>
377
+ <role>
378
+ Your role: Suggest code improvements.
379
+ </role>
380
+ <instructions>
381
+ Focus on:
382
+ - Code quality
383
+ - Performance
384
+ - Readability
385
+ - Best practices
386
+ - Design patterns
387
+ </instructions>
388
+ <input>
389
+ Code to refactor: {prompt}
390
+ </input>
391
+ <output>
392
+ Suggestions:
393
+ </output>
394
+ </system_context>
395
+ """
256
396
 
257
397
  @staticmethod
258
- def security(prompt):
398
+ def security(prompt: str) -> str:
259
399
  """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
- )
400
+ return f"""
401
+ <system_context>
402
+ <role>
403
+ Your role: Security analysis and fixes.
404
+ </role>
405
+ <instructions>
406
+ Check for:
407
+ - Common vulnerabilities
408
+ - Security best practices
409
+ - Input validation
410
+ - Authentication/Authorization
411
+ - Data protection
412
+ </instructions>
413
+ <input>
414
+ Code to analyze: {prompt}
415
+ </input>
416
+ <output>
417
+ Analysis:
418
+ </output>
419
+ </system_context>
420
+ """
@@ -2,10 +2,7 @@
2
2
  Scout: A powerful, zero-dependency web scraping library
3
3
  """
4
4
 
5
- from .core import Scout
5
+ from .core import Scout, ScoutCrawler, ScoutTextAnalyzer, ScoutWebAnalyzer, ScoutSearchResult
6
6
  from .element import Tag, NavigableString
7
7
 
8
- __all__ = ['Scout', 'Tag', 'NavigableString']
9
-
10
- # Alias for BeautifulSoup compatibility
11
- BeautifulSoup = Scout
8
+ __all__ = ['Scout', 'ScoutCrawler', 'Tag', 'NavigableString','ScoutTextAnalyzer', 'ScoutWebAnalyzer', 'ScoutSearchResult']
@@ -0,0 +1,7 @@
1
+ from .text_analyzer import ScoutTextAnalyzer
2
+ from .web_analyzer import ScoutWebAnalyzer
3
+ from .search_result import ScoutSearchResult
4
+ from .crawler import ScoutCrawler
5
+ from .scout import Scout
6
+
7
+ __all__ = ['ScoutTextAnalyzer', 'ScoutWebAnalyzer', 'ScoutSearchResult', 'ScoutCrawler', 'Scout']