webscout 8.2.6__py3-none-any.whl → 8.2.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 (292) hide show
  1. webscout/AIutel.py +97 -87
  2. webscout/version.py +1 -1
  3. {webscout-8.2.6.dist-info → webscout-8.2.7.dist-info}/METADATA +2 -15
  4. webscout-8.2.7.dist-info/RECORD +26 -0
  5. {webscout-8.2.6.dist-info → webscout-8.2.7.dist-info}/WHEEL +1 -1
  6. webscout-8.2.7.dist-info/entry_points.txt +3 -0
  7. webscout-8.2.7.dist-info/top_level.txt +1 -0
  8. webscout/Extra/GitToolkit/__init__.py +0 -10
  9. webscout/Extra/GitToolkit/gitapi/__init__.py +0 -12
  10. webscout/Extra/GitToolkit/gitapi/repository.py +0 -195
  11. webscout/Extra/GitToolkit/gitapi/user.py +0 -96
  12. webscout/Extra/GitToolkit/gitapi/utils.py +0 -62
  13. webscout/Extra/YTToolkit/YTdownloader.py +0 -957
  14. webscout/Extra/YTToolkit/__init__.py +0 -3
  15. webscout/Extra/YTToolkit/transcriber.py +0 -476
  16. webscout/Extra/YTToolkit/ytapi/__init__.py +0 -6
  17. webscout/Extra/YTToolkit/ytapi/channel.py +0 -307
  18. webscout/Extra/YTToolkit/ytapi/errors.py +0 -13
  19. webscout/Extra/YTToolkit/ytapi/extras.py +0 -45
  20. webscout/Extra/YTToolkit/ytapi/https.py +0 -88
  21. webscout/Extra/YTToolkit/ytapi/patterns.py +0 -61
  22. webscout/Extra/YTToolkit/ytapi/playlist.py +0 -59
  23. webscout/Extra/YTToolkit/ytapi/pool.py +0 -8
  24. webscout/Extra/YTToolkit/ytapi/query.py +0 -40
  25. webscout/Extra/YTToolkit/ytapi/stream.py +0 -63
  26. webscout/Extra/YTToolkit/ytapi/utils.py +0 -62
  27. webscout/Extra/YTToolkit/ytapi/video.py +0 -232
  28. webscout/Extra/__init__.py +0 -7
  29. webscout/Extra/autocoder/__init__.py +0 -9
  30. webscout/Extra/autocoder/autocoder.py +0 -910
  31. webscout/Extra/autocoder/autocoder_utiles.py +0 -332
  32. webscout/Extra/gguf.py +0 -684
  33. webscout/Extra/tempmail/__init__.py +0 -28
  34. webscout/Extra/tempmail/async_utils.py +0 -141
  35. webscout/Extra/tempmail/base.py +0 -161
  36. webscout/Extra/tempmail/cli.py +0 -187
  37. webscout/Extra/tempmail/emailnator.py +0 -84
  38. webscout/Extra/tempmail/mail_tm.py +0 -361
  39. webscout/Extra/tempmail/temp_mail_io.py +0 -292
  40. webscout/Extra/weather.py +0 -194
  41. webscout/Extra/weather_ascii.py +0 -76
  42. webscout/Litlogger/__init__.py +0 -67
  43. webscout/Litlogger/core/__init__.py +0 -6
  44. webscout/Litlogger/core/level.py +0 -23
  45. webscout/Litlogger/core/logger.py +0 -165
  46. webscout/Litlogger/handlers/__init__.py +0 -12
  47. webscout/Litlogger/handlers/console.py +0 -33
  48. webscout/Litlogger/handlers/file.py +0 -143
  49. webscout/Litlogger/handlers/network.py +0 -173
  50. webscout/Litlogger/styles/__init__.py +0 -7
  51. webscout/Litlogger/styles/colors.py +0 -249
  52. webscout/Litlogger/styles/formats.py +0 -458
  53. webscout/Litlogger/styles/text.py +0 -87
  54. webscout/Litlogger/utils/__init__.py +0 -6
  55. webscout/Litlogger/utils/detectors.py +0 -153
  56. webscout/Litlogger/utils/formatters.py +0 -200
  57. webscout/Provider/AI21.py +0 -177
  58. webscout/Provider/AISEARCH/DeepFind.py +0 -250
  59. webscout/Provider/AISEARCH/ISou.py +0 -256
  60. webscout/Provider/AISEARCH/Perplexity.py +0 -359
  61. webscout/Provider/AISEARCH/__init__.py +0 -10
  62. webscout/Provider/AISEARCH/felo_search.py +0 -228
  63. webscout/Provider/AISEARCH/genspark_search.py +0 -208
  64. webscout/Provider/AISEARCH/hika_search.py +0 -198
  65. webscout/Provider/AISEARCH/iask_search.py +0 -436
  66. webscout/Provider/AISEARCH/monica_search.py +0 -246
  67. webscout/Provider/AISEARCH/scira_search.py +0 -322
  68. webscout/Provider/AISEARCH/webpilotai_search.py +0 -281
  69. webscout/Provider/Aitopia.py +0 -316
  70. webscout/Provider/AllenAI.py +0 -447
  71. webscout/Provider/Andi.py +0 -228
  72. webscout/Provider/Blackboxai.py +0 -229
  73. webscout/Provider/ChatGPTClone.py +0 -237
  74. webscout/Provider/ChatGPTGratis.py +0 -194
  75. webscout/Provider/ChatSandbox.py +0 -342
  76. webscout/Provider/Cloudflare.py +0 -325
  77. webscout/Provider/Cohere.py +0 -208
  78. webscout/Provider/Deepinfra.py +0 -338
  79. webscout/Provider/ElectronHub.py +0 -773
  80. webscout/Provider/ExaAI.py +0 -261
  81. webscout/Provider/ExaChat.py +0 -358
  82. webscout/Provider/Free2GPT.py +0 -241
  83. webscout/Provider/GPTWeb.py +0 -249
  84. webscout/Provider/Gemini.py +0 -169
  85. webscout/Provider/GithubChat.py +0 -370
  86. webscout/Provider/GizAI.py +0 -285
  87. webscout/Provider/Glider.py +0 -222
  88. webscout/Provider/Groq.py +0 -801
  89. webscout/Provider/HF_space/__init__.py +0 -0
  90. webscout/Provider/HF_space/qwen_qwen2.py +0 -206
  91. webscout/Provider/HeckAI.py +0 -257
  92. webscout/Provider/HuggingFaceChat.py +0 -469
  93. webscout/Provider/Hunyuan.py +0 -283
  94. webscout/Provider/Jadve.py +0 -291
  95. webscout/Provider/Koboldai.py +0 -381
  96. webscout/Provider/LambdaChat.py +0 -411
  97. webscout/Provider/Llama3.py +0 -259
  98. webscout/Provider/MCPCore.py +0 -315
  99. webscout/Provider/Marcus.py +0 -206
  100. webscout/Provider/Nemotron.py +0 -218
  101. webscout/Provider/Netwrck.py +0 -270
  102. webscout/Provider/OLLAMA.py +0 -396
  103. webscout/Provider/OPENAI/__init__.py +0 -28
  104. webscout/Provider/OPENAI/ai4chat.py +0 -286
  105. webscout/Provider/OPENAI/base.py +0 -46
  106. webscout/Provider/OPENAI/c4ai.py +0 -367
  107. webscout/Provider/OPENAI/chatgpt.py +0 -549
  108. webscout/Provider/OPENAI/chatgptclone.py +0 -481
  109. webscout/Provider/OPENAI/deepinfra.py +0 -309
  110. webscout/Provider/OPENAI/e2b.py +0 -1350
  111. webscout/Provider/OPENAI/exaai.py +0 -404
  112. webscout/Provider/OPENAI/exachat.py +0 -437
  113. webscout/Provider/OPENAI/freeaichat.py +0 -352
  114. webscout/Provider/OPENAI/glider.py +0 -316
  115. webscout/Provider/OPENAI/groq.py +0 -354
  116. webscout/Provider/OPENAI/heckai.py +0 -341
  117. webscout/Provider/OPENAI/llmchatco.py +0 -327
  118. webscout/Provider/OPENAI/mcpcore.py +0 -376
  119. webscout/Provider/OPENAI/multichat.py +0 -368
  120. webscout/Provider/OPENAI/netwrck.py +0 -350
  121. webscout/Provider/OPENAI/opkfc.py +0 -488
  122. webscout/Provider/OPENAI/scirachat.py +0 -462
  123. webscout/Provider/OPENAI/sonus.py +0 -294
  124. webscout/Provider/OPENAI/standardinput.py +0 -425
  125. webscout/Provider/OPENAI/textpollinations.py +0 -329
  126. webscout/Provider/OPENAI/toolbaz.py +0 -406
  127. webscout/Provider/OPENAI/typegpt.py +0 -346
  128. webscout/Provider/OPENAI/uncovrAI.py +0 -455
  129. webscout/Provider/OPENAI/utils.py +0 -211
  130. webscout/Provider/OPENAI/venice.py +0 -413
  131. webscout/Provider/OPENAI/wisecat.py +0 -381
  132. webscout/Provider/OPENAI/writecream.py +0 -156
  133. webscout/Provider/OPENAI/x0gpt.py +0 -371
  134. webscout/Provider/OPENAI/yep.py +0 -327
  135. webscout/Provider/OpenGPT.py +0 -209
  136. webscout/Provider/Openai.py +0 -496
  137. webscout/Provider/PI.py +0 -429
  138. webscout/Provider/Perplexitylabs.py +0 -415
  139. webscout/Provider/QwenLM.py +0 -254
  140. webscout/Provider/Reka.py +0 -214
  141. webscout/Provider/StandardInput.py +0 -290
  142. webscout/Provider/TTI/AiForce/__init__.py +0 -22
  143. webscout/Provider/TTI/AiForce/async_aiforce.py +0 -224
  144. webscout/Provider/TTI/AiForce/sync_aiforce.py +0 -245
  145. webscout/Provider/TTI/FreeAIPlayground/__init__.py +0 -9
  146. webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +0 -181
  147. webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +0 -180
  148. webscout/Provider/TTI/ImgSys/__init__.py +0 -23
  149. webscout/Provider/TTI/ImgSys/async_imgsys.py +0 -202
  150. webscout/Provider/TTI/ImgSys/sync_imgsys.py +0 -195
  151. webscout/Provider/TTI/MagicStudio/__init__.py +0 -2
  152. webscout/Provider/TTI/MagicStudio/async_magicstudio.py +0 -111
  153. webscout/Provider/TTI/MagicStudio/sync_magicstudio.py +0 -109
  154. webscout/Provider/TTI/Nexra/__init__.py +0 -22
  155. webscout/Provider/TTI/Nexra/async_nexra.py +0 -286
  156. webscout/Provider/TTI/Nexra/sync_nexra.py +0 -258
  157. webscout/Provider/TTI/PollinationsAI/__init__.py +0 -23
  158. webscout/Provider/TTI/PollinationsAI/async_pollinations.py +0 -311
  159. webscout/Provider/TTI/PollinationsAI/sync_pollinations.py +0 -265
  160. webscout/Provider/TTI/__init__.py +0 -12
  161. webscout/Provider/TTI/aiarta/__init__.py +0 -2
  162. webscout/Provider/TTI/aiarta/async_aiarta.py +0 -482
  163. webscout/Provider/TTI/aiarta/sync_aiarta.py +0 -440
  164. webscout/Provider/TTI/artbit/__init__.py +0 -22
  165. webscout/Provider/TTI/artbit/async_artbit.py +0 -155
  166. webscout/Provider/TTI/artbit/sync_artbit.py +0 -148
  167. webscout/Provider/TTI/fastflux/__init__.py +0 -22
  168. webscout/Provider/TTI/fastflux/async_fastflux.py +0 -261
  169. webscout/Provider/TTI/fastflux/sync_fastflux.py +0 -252
  170. webscout/Provider/TTI/huggingface/__init__.py +0 -22
  171. webscout/Provider/TTI/huggingface/async_huggingface.py +0 -199
  172. webscout/Provider/TTI/huggingface/sync_huggingface.py +0 -195
  173. webscout/Provider/TTI/piclumen/__init__.py +0 -23
  174. webscout/Provider/TTI/piclumen/async_piclumen.py +0 -268
  175. webscout/Provider/TTI/piclumen/sync_piclumen.py +0 -233
  176. webscout/Provider/TTI/pixelmuse/__init__.py +0 -4
  177. webscout/Provider/TTI/pixelmuse/async_pixelmuse.py +0 -249
  178. webscout/Provider/TTI/pixelmuse/sync_pixelmuse.py +0 -182
  179. webscout/Provider/TTI/talkai/__init__.py +0 -4
  180. webscout/Provider/TTI/talkai/async_talkai.py +0 -229
  181. webscout/Provider/TTI/talkai/sync_talkai.py +0 -207
  182. webscout/Provider/TTS/__init__.py +0 -8
  183. webscout/Provider/TTS/base.py +0 -159
  184. webscout/Provider/TTS/deepgram.py +0 -156
  185. webscout/Provider/TTS/elevenlabs.py +0 -111
  186. webscout/Provider/TTS/gesserit.py +0 -128
  187. webscout/Provider/TTS/murfai.py +0 -113
  188. webscout/Provider/TTS/parler.py +0 -111
  189. webscout/Provider/TTS/speechma.py +0 -180
  190. webscout/Provider/TTS/streamElements.py +0 -333
  191. webscout/Provider/TTS/utils.py +0 -280
  192. webscout/Provider/TeachAnything.py +0 -233
  193. webscout/Provider/TextPollinationsAI.py +0 -306
  194. webscout/Provider/TwoAI.py +0 -280
  195. webscout/Provider/TypliAI.py +0 -305
  196. webscout/Provider/Venice.py +0 -258
  197. webscout/Provider/VercelAI.py +0 -253
  198. webscout/Provider/WiseCat.py +0 -233
  199. webscout/Provider/WrDoChat.py +0 -370
  200. webscout/Provider/Writecream.py +0 -237
  201. webscout/Provider/WritingMate.py +0 -269
  202. webscout/Provider/Youchat.py +0 -330
  203. webscout/Provider/__init__.py +0 -178
  204. webscout/Provider/ai4chat.py +0 -203
  205. webscout/Provider/aimathgpt.py +0 -189
  206. webscout/Provider/akashgpt.py +0 -335
  207. webscout/Provider/asksteve.py +0 -212
  208. webscout/Provider/bagoodex.py +0 -145
  209. webscout/Provider/cerebras.py +0 -288
  210. webscout/Provider/chatglm.py +0 -215
  211. webscout/Provider/cleeai.py +0 -213
  212. webscout/Provider/copilot.py +0 -425
  213. webscout/Provider/elmo.py +0 -283
  214. webscout/Provider/freeaichat.py +0 -285
  215. webscout/Provider/geminiapi.py +0 -208
  216. webscout/Provider/geminiprorealtime.py +0 -160
  217. webscout/Provider/granite.py +0 -235
  218. webscout/Provider/hermes.py +0 -266
  219. webscout/Provider/julius.py +0 -223
  220. webscout/Provider/koala.py +0 -268
  221. webscout/Provider/learnfastai.py +0 -325
  222. webscout/Provider/llama3mitril.py +0 -215
  223. webscout/Provider/llmchat.py +0 -255
  224. webscout/Provider/llmchatco.py +0 -306
  225. webscout/Provider/meta.py +0 -798
  226. webscout/Provider/multichat.py +0 -364
  227. webscout/Provider/scira_chat.py +0 -297
  228. webscout/Provider/scnet.py +0 -243
  229. webscout/Provider/searchchat.py +0 -292
  230. webscout/Provider/sonus.py +0 -258
  231. webscout/Provider/talkai.py +0 -194
  232. webscout/Provider/toolbaz.py +0 -353
  233. webscout/Provider/turboseek.py +0 -266
  234. webscout/Provider/typefully.py +0 -330
  235. webscout/Provider/typegpt.py +0 -289
  236. webscout/Provider/uncovr.py +0 -368
  237. webscout/Provider/x0gpt.py +0 -299
  238. webscout/Provider/yep.py +0 -389
  239. webscout/litagent/__init__.py +0 -29
  240. webscout/litagent/agent.py +0 -455
  241. webscout/litagent/constants.py +0 -60
  242. webscout/litprinter/__init__.py +0 -59
  243. webscout/scout/__init__.py +0 -8
  244. webscout/scout/core/__init__.py +0 -7
  245. webscout/scout/core/crawler.py +0 -140
  246. webscout/scout/core/scout.py +0 -568
  247. webscout/scout/core/search_result.py +0 -96
  248. webscout/scout/core/text_analyzer.py +0 -63
  249. webscout/scout/core/text_utils.py +0 -277
  250. webscout/scout/core/web_analyzer.py +0 -52
  251. webscout/scout/core.py +0 -881
  252. webscout/scout/element.py +0 -460
  253. webscout/scout/parsers/__init__.py +0 -69
  254. webscout/scout/parsers/html5lib_parser.py +0 -172
  255. webscout/scout/parsers/html_parser.py +0 -236
  256. webscout/scout/parsers/lxml_parser.py +0 -178
  257. webscout/scout/utils.py +0 -37
  258. webscout/swiftcli/__init__.py +0 -95
  259. webscout/swiftcli/core/__init__.py +0 -7
  260. webscout/swiftcli/core/cli.py +0 -297
  261. webscout/swiftcli/core/context.py +0 -104
  262. webscout/swiftcli/core/group.py +0 -241
  263. webscout/swiftcli/decorators/__init__.py +0 -28
  264. webscout/swiftcli/decorators/command.py +0 -221
  265. webscout/swiftcli/decorators/options.py +0 -220
  266. webscout/swiftcli/decorators/output.py +0 -252
  267. webscout/swiftcli/exceptions.py +0 -21
  268. webscout/swiftcli/plugins/__init__.py +0 -9
  269. webscout/swiftcli/plugins/base.py +0 -135
  270. webscout/swiftcli/plugins/manager.py +0 -262
  271. webscout/swiftcli/utils/__init__.py +0 -59
  272. webscout/swiftcli/utils/formatting.py +0 -252
  273. webscout/swiftcli/utils/parsing.py +0 -267
  274. webscout/zeroart/__init__.py +0 -55
  275. webscout/zeroart/base.py +0 -60
  276. webscout/zeroart/effects.py +0 -99
  277. webscout/zeroart/fonts.py +0 -816
  278. webscout-8.2.6.dist-info/RECORD +0 -307
  279. webscout-8.2.6.dist-info/entry_points.txt +0 -3
  280. webscout-8.2.6.dist-info/top_level.txt +0 -2
  281. webstoken/__init__.py +0 -30
  282. webstoken/classifier.py +0 -189
  283. webstoken/keywords.py +0 -216
  284. webstoken/language.py +0 -128
  285. webstoken/ner.py +0 -164
  286. webstoken/normalizer.py +0 -35
  287. webstoken/processor.py +0 -77
  288. webstoken/sentiment.py +0 -206
  289. webstoken/stemmer.py +0 -73
  290. webstoken/tagger.py +0 -60
  291. webstoken/tokenizer.py +0 -158
  292. {webscout-8.2.6.dist-info → webscout-8.2.7.dist-info}/licenses/LICENSE.md +0 -0
webscout/AIutel.py CHANGED
@@ -1,9 +1,5 @@
1
1
  import json
2
- import platform
3
- import subprocess
4
- from typing import Union, Optional, Dict, Any, Iterable, Generator, List, Callable, Literal, Tuple
5
- import io
6
- from collections import deque
2
+ from typing import Union, Optional, Dict, Any, Iterable, Generator, List, Callable, Literal
7
3
  import codecs
8
4
 
9
5
  # Expanded encoding types
@@ -23,34 +19,34 @@ def _process_chunk(
23
19
  if not isinstance(chunk, str):
24
20
  return None
25
21
 
26
- sanitized_chunk = chunk
27
-
28
- # Check if chunk starts with intro_value + skip_marker combination
29
- if intro_value and skip_markers:
30
- for marker in skip_markers:
31
- combined_marker = f"{intro_value}{marker}"
32
- if sanitized_chunk.startswith(combined_marker):
33
- return None
22
+ # Fast path for empty chunks
23
+ if not chunk:
24
+ return None
34
25
 
35
- if intro_value and sanitized_chunk.startswith(intro_value):
36
- sanitized_chunk = sanitized_chunk[len(intro_value):]
26
+ # Use slicing for prefix removal (faster than startswith+slicing)
27
+ sanitized_chunk = chunk
28
+ if intro_value and len(chunk) >= len(intro_value) and chunk[:len(intro_value)] == intro_value:
29
+ sanitized_chunk = chunk[len(intro_value):]
37
30
 
31
+ # Optimize string stripping operations
38
32
  if strip_chars is not None:
39
33
  sanitized_chunk = sanitized_chunk.strip(strip_chars)
40
34
  else:
35
+ # lstrip() is faster than strip() when we only need leading whitespace removed
41
36
  sanitized_chunk = sanitized_chunk.lstrip()
42
37
 
43
- # Check both standalone skip_markers and stripped version
44
- if not sanitized_chunk or any(
45
- marker in sanitized_chunk or sanitized_chunk == marker
46
- for marker in skip_markers
47
- ):
38
+ # Skip empty chunks and markers
39
+ if not sanitized_chunk or any(marker == sanitized_chunk for marker in skip_markers):
48
40
  return None
49
41
 
42
+ # JSON parsing with optimized error handling
50
43
  if to_json:
51
44
  try:
45
+ # Only strip before JSON parsing if needed
46
+ if sanitized_chunk[0] not in '{[' or sanitized_chunk[-1] not in '}]':
47
+ sanitized_chunk = sanitized_chunk.strip()
52
48
  return json.loads(sanitized_chunk)
53
- except (json.JSONDecodeError, Exception) as e:
49
+ except (json.JSONDecodeError, Exception):
54
50
  return sanitized_chunk if yield_raw_on_error else None
55
51
 
56
52
  return sanitized_chunk
@@ -58,7 +54,8 @@ def _process_chunk(
58
54
  def _decode_byte_stream(
59
55
  byte_iterator: Iterable[bytes],
60
56
  encoding: EncodingType = 'utf-8',
61
- errors: str = 'replace'
57
+ errors: str = 'replace',
58
+ buffer_size: int = 8192
62
59
  ) -> Generator[str, None, None]:
63
60
  """
64
61
  Realtime byte stream decoder with flexible encoding support.
@@ -67,6 +64,7 @@ def _decode_byte_stream(
67
64
  byte_iterator: Iterator yielding bytes
68
65
  encoding: Character encoding to use
69
66
  errors: How to handle encoding errors ('strict', 'ignore', 'replace')
67
+ buffer_size: Size of internal buffer for performance tuning
70
68
  """
71
69
  # Initialize decoder with the specified encoding
72
70
  try:
@@ -76,13 +74,21 @@ def _decode_byte_stream(
76
74
  decoder = codecs.getincrementaldecoder('utf-8')(errors=errors)
77
75
 
78
76
  # Process byte stream in realtime
77
+ buffer = bytearray(buffer_size)
78
+ buffer_view = memoryview(buffer)
79
+
79
80
  for chunk_bytes in byte_iterator:
80
81
  if not chunk_bytes:
81
82
  continue
82
83
 
83
84
  try:
84
- # Decode chunk with specified encoding
85
- text = decoder.decode(chunk_bytes, final=False)
85
+ # Use buffer for processing if chunk size is appropriate
86
+ if len(chunk_bytes) <= buffer_size:
87
+ buffer[:len(chunk_bytes)] = chunk_bytes
88
+ text = decoder.decode(buffer_view[:len(chunk_bytes)], final=False)
89
+ else:
90
+ text = decoder.decode(chunk_bytes, final=False)
91
+
86
92
  if text:
87
93
  yield text
88
94
  except UnicodeDecodeError:
@@ -95,8 +101,9 @@ def _decode_byte_stream(
95
101
  yield final_text
96
102
  except UnicodeDecodeError:
97
103
  yield f"[Encoding Error: Could not decode final bytes with {encoding}]\n"
104
+
98
105
  def sanitize_stream(
99
- data: Union[str, bytes, Iterable[str], Iterable[bytes]],
106
+ data: Union[str, Iterable[str], Iterable[bytes]],
100
107
  intro_value: str = "data:",
101
108
  to_json: bool = True,
102
109
  skip_markers: Optional[List[str]] = None,
@@ -107,17 +114,17 @@ def sanitize_stream(
107
114
  yield_raw_on_error: bool = True,
108
115
  encoding: EncodingType = 'utf-8',
109
116
  encoding_errors: str = 'replace',
110
- chunk_size: Optional[int] = None,
117
+ buffer_size: int = 8192,
111
118
  ) -> Generator[Any, None, None]:
112
119
  """
113
- Realtime stream processor that handles string/byte streams with minimal latency.
120
+ Optimized realtime stream processor that handles string/byte streams with minimal latency.
114
121
 
115
122
  Features:
116
123
  - Direct realtime processing of byte streams
117
124
  - Optimized string handling and JSON parsing
118
125
  - Robust error handling and validation
119
- - Flexible encoding support
120
- - Drop-in replacement for response.iter_content/iter_lines
126
+ - Flexible encoding support with memory-efficient buffering
127
+ - High performance for large streams
121
128
 
122
129
  Args:
123
130
  data: Input data (string, string iterator, or bytes iterator)
@@ -129,93 +136,91 @@ def sanitize_stream(
129
136
  end_marker: Processing end marker
130
137
  content_extractor: Function to extract content
131
138
  yield_raw_on_error: Yield raw content on JSON errors
132
- encoding: Character encoding for byte streams ('utf-8', 'latin1', etc.)
133
- encoding_errors: How to handle encoding errors ('strict', 'ignore', 'replace')
134
- chunk_size: Chunk size for byte streams (None for default)
139
+ encoding: Character encoding for byte streams
140
+ encoding_errors: How to handle encoding errors
141
+ buffer_size: Size of internal processing buffer
135
142
 
136
143
  Yields:
137
144
  Processed chunks (string or dictionary)
138
-
139
- Example:
140
- >>> # Process response content
141
- >>> for chunk in sanitize_stream(response.iter_content()):
142
- ... process_chunk(chunk)
143
-
144
- >>> # Process a stream with specific encoding
145
- >>> for text in sanitize_stream(byte_stream, encoding='latin1', to_json=False):
146
- ... process_text(text)
147
145
  """
148
146
  effective_skip_markers = skip_markers or []
149
147
  processing_active = start_marker is None
150
148
 
151
- if isinstance(data, (str, bytes)):
152
- # Optimized single string/bytes processing
149
+ # Fast path for single string processing
150
+ if isinstance(data, str):
153
151
  processed_item = None
154
- if isinstance(data, bytes):
155
- data = data.decode(encoding, errors=encoding_errors)
156
- if to_json:
157
- try:
158
- processed_item = json.loads(data)
159
- except json.JSONDecodeError:
160
- pass
161
-
162
- if processed_item is None:
163
- if not processing_active and data == start_marker:
164
- processing_active = True
165
- elif processing_active and end_marker is not None and data == end_marker:
166
- processing_active = False
167
-
168
- if processing_active:
152
+ if processing_active:
153
+ # Optimize JSON parsing for large strings
154
+ if to_json:
155
+ try:
156
+ # Use faster JSON parser for large strings
157
+ data = data.strip()
158
+ if data:
159
+ processed_item = json.loads(data)
160
+ except json.JSONDecodeError:
161
+ processed_item = data if yield_raw_on_error else None
162
+ else:
169
163
  processed_item = _process_chunk(
170
- data, intro_value, to_json, effective_skip_markers,
164
+ data, intro_value, False, effective_skip_markers,
171
165
  strip_chars, yield_raw_on_error
172
166
  )
173
167
 
174
- if processed_item is not None:
175
- if content_extractor:
176
- try:
177
- final_content = content_extractor(processed_item)
178
- if final_content is not None:
179
- yield final_content
180
- except Exception:
181
- pass
182
- else:
183
- yield processed_item
184
-
185
- elif hasattr(data, '__iter__') or hasattr(data, 'iter_content'):
186
- # Efficient stream processing
187
- try:
188
- if hasattr(data, 'iter_content'):
189
- data = data.iter_content(chunk_size=chunk_size)
190
- first_item = next(iter(data))
191
- except StopIteration:
168
+ if processed_item is not None:
169
+ if content_extractor:
170
+ try:
171
+ final_content = content_extractor(processed_item)
172
+ if final_content is not None:
173
+ yield final_content
174
+ except Exception:
175
+ pass
176
+ else:
177
+ yield processed_item
178
+ return
179
+
180
+ # Stream processing path
181
+ if not hasattr(data, '__iter__'):
182
+ raise TypeError(f"Input must be a string or an iterable, not {type(data).__name__}")
183
+
184
+ try:
185
+ iterator = iter(data)
186
+ first_item = next(iterator, None)
187
+ if first_item is None:
192
188
  return
193
-
189
+
190
+ # Efficient streaming with itertools
194
191
  from itertools import chain
195
- stream = chain([first_item], data)
192
+ stream = chain([first_item], iterator)
196
193
 
197
- # Choose processing path based on type
194
+ # Determine if we're dealing with bytes or strings
198
195
  if isinstance(first_item, bytes):
199
196
  line_iterator = _decode_byte_stream(
200
197
  stream,
201
198
  encoding=encoding,
202
- errors=encoding_errors
199
+ errors=encoding_errors,
200
+ buffer_size=buffer_size
203
201
  )
204
202
  elif isinstance(first_item, str):
205
203
  line_iterator = stream
206
204
  else:
207
205
  raise TypeError(f"Stream must yield strings or bytes, not {type(first_item).__name__}")
208
206
 
209
- # Process stream efficiently
207
+ # Process stream with minimal allocations
210
208
  for line in line_iterator:
211
- if not processing_active and start_marker is not None and line == start_marker:
212
- processing_active = True
209
+ if not line:
210
+ continue
211
+
212
+ # Handle markers efficiently
213
+ if not processing_active and start_marker is not None:
214
+ if line.strip() == start_marker:
215
+ processing_active = True
213
216
  continue
214
- if processing_active and end_marker is not None and line == end_marker:
217
+
218
+ if processing_active and end_marker is not None and line.strip() == end_marker:
215
219
  processing_active = False
216
220
  continue
217
221
 
218
222
  if processing_active:
223
+ # Process chunk with optimized function
219
224
  processed = _process_chunk(
220
225
  line, intro_value, to_json, effective_skip_markers,
221
226
  strip_chars, yield_raw_on_error
@@ -228,11 +233,16 @@ def sanitize_stream(
228
233
  if final_content is not None:
229
234
  yield final_content
230
235
  except Exception:
236
+ # Continue on extraction errors
231
237
  pass
232
238
  else:
233
239
  yield processed
234
- else:
235
- raise TypeError(f"Input must be a string or an iterable, not {type(data).__name__}")
240
+
241
+ except Exception as e:
242
+ # Log error but don't crash on stream processing exceptions
243
+ import sys
244
+ print(f"Stream processing error: {str(e)}", file=sys.stderr)
245
+
236
246
 
237
247
  from .conversation import Conversation
238
248
  from .optimizers import Optimizers
webscout/version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "8.2.6"
1
+ __version__ = "8.2.7"
2
2
  __prog__ = "webscout"
@@ -1,9 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webscout
3
- Version: 8.2.6
3
+ Version: 8.2.7
4
4
  Summary: Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs and more
5
- Author: OEvortex
6
- Author-email: helpingai5@gmail.com
5
+ Author-email: OEvortex <helpingai5@gmail.com>
7
6
  License: HelpingAI
8
7
  Project-URL: Source, https://github.com/OE-LUCIFER/Webscout
9
8
  Project-URL: Tracker, https://github.com/OE-LUCIFER/Webscout/issues
@@ -68,19 +67,7 @@ Requires-Dist: aiohttp
68
67
  Provides-Extra: dev
69
68
  Requires-Dist: ruff>=0.1.6; extra == "dev"
70
69
  Requires-Dist: pytest>=7.4.2; extra == "dev"
71
- Dynamic: author
72
- Dynamic: author-email
73
- Dynamic: classifier
74
- Dynamic: description
75
- Dynamic: description-content-type
76
- Dynamic: keywords
77
- Dynamic: license
78
70
  Dynamic: license-file
79
- Dynamic: project-url
80
- Dynamic: provides-extra
81
- Dynamic: requires-dist
82
- Dynamic: requires-python
83
- Dynamic: summary
84
71
 
85
72
  <div align="center">
86
73
  <a href="https://github.com/OEvortex/Webscout">
@@ -0,0 +1,26 @@
1
+ webscout/AIauto.py,sha256=SvOhkz1irK67s-SHKUnGp6NHirejr51xV4qg5ZNdQMY,9276
2
+ webscout/AIbase.py,sha256=ejzsyXAK82eo-2Cg8epljxlxrcHnQeeLt6SKurePOVY,9272
3
+ webscout/AIutel.py,sha256=qbvLy52BhrF0G2TPT4oPkYR7tW-CqOxlUnqZ21Zcq5A,9339
4
+ webscout/Bard.py,sha256=T4X1aQczWU8XyvWqVLvp_JxnHHz5GTbdrM9RRK9Bq5Y,41046
5
+ webscout/DWEBS.py,sha256=OnoKtIkrlNtYlGL_CCPsLet8cj2wKxqquFB8RdBxXfk,18621
6
+ webscout/__init__.py,sha256=vOmNYCYC0bJ2mSMCIqrFl3E7gwMudGj0kELPcTwZz7M,1033
7
+ webscout/__main__.py,sha256=qtkMZK5jzQ79ZkFAuZBxMgayuhmw3aRDj1F8Pt06NW4,108
8
+ webscout/cli.py,sha256=kn-HoPlgzyWns0cCCMXncB1UsqChE0DYSQgWcJPysHw,21300
9
+ webscout/conversation.py,sha256=8pKCbU5bObVrzGCFhSnFnFOpNFzyjeD-oWk4ON3621A,16881
10
+ webscout/exceptions.py,sha256=cj0BDCZhB46g_vJ0r2PH0U_T35dqZro-rWu6tvtIZ3c,12833
11
+ webscout/models.py,sha256=C7QY-KDkqFCI698t9pvTHQ27rYadPIvwaYHJ3-AOCJI,6566
12
+ webscout/optimizers.py,sha256=NlnxWCav7cTyjfeLHuq2pUCgqgW1pljWbMTklHYMGwo,9954
13
+ webscout/prompt_manager.py,sha256=j4MLYx3SpeeTxzsbgUGAHWLtJ1HAF6eaWOzJCAiGND4,10090
14
+ webscout/tempid.py,sha256=lqTTOjVSwDMmC0UoThdyshFyIAxTikVaN613-6K3g_s,4968
15
+ webscout/update_checker.py,sha256=5FCr6p1zLVASXcXkxKEgR7bFvICbpzJdgRTr3teKFCs,4217
16
+ webscout/utils.py,sha256=o2hU3qaVPk25sog3e4cyVZO3l8xwaZpYRziZPotEzNo,3075
17
+ webscout/version.py,sha256=UCzUXtD1UABNyj0mB_wplcbyHX8vDgyo3Gz8ZXpiZUM,46
18
+ webscout/webscout_search.py,sha256=aEv6_wcwFWomfUGUm-udHdMKULcMbv6SR3Gxhx8ycdQ,56691
19
+ webscout/webscout_search_async.py,sha256=SS6hLvlMRQT_KNuqZUfSuL7Tz-KTEDIXCn97yXSsNeI,35870
20
+ webscout/yep_search.py,sha256=gCXleUK_1Gy6B6fMPZ8MurwboPiMmbft3bhk1qISCdQ,12295
21
+ webscout-8.2.7.dist-info/licenses/LICENSE.md,sha256=hyfFlVn7pWcrvuvs-piB8k4J8DlXdOsYje9RyPxc6Ik,7543
22
+ webscout-8.2.7.dist-info/METADATA,sha256=CNFfzkf_Ckt1GW6WLALOfxKxX1xIRA200OEOEZxywUc,29334
23
+ webscout-8.2.7.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
24
+ webscout-8.2.7.dist-info/entry_points.txt,sha256=O_97lvOdImKPfdf3k_pT63sRXGyqooR8DytlD03ZCY4,72
25
+ webscout-8.2.7.dist-info/top_level.txt,sha256=nYIw7OKBQDr_Z33IzZUKidRD3zQEo8jOJYkMVMeN334,9
26
+ webscout-8.2.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.1.0)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ WEBS = webscout.cli:main
3
+ webscout = webscout.cli:main
@@ -0,0 +1 @@
1
+ webscout
@@ -1,10 +0,0 @@
1
- from .gitapi import *
2
-
3
- __all__ = [
4
- 'Repository',
5
- 'User',
6
- 'GitError',
7
- 'RateLimitError',
8
- 'NotFoundError',
9
- 'RequestError'
10
- ]
@@ -1,12 +0,0 @@
1
- from .repository import Repository
2
- from .user import User
3
- from .utils import GitError, RateLimitError, NotFoundError, RequestError
4
-
5
- __all__ = [
6
- 'Repository',
7
- 'User',
8
- 'GitError',
9
- 'RateLimitError',
10
- 'NotFoundError',
11
- 'RequestError'
12
- ]
@@ -1,195 +0,0 @@
1
- from typing import List, Dict, Any, Optional
2
- from .utils import request
3
- from urllib.parse import quote
4
-
5
- class Repository:
6
- """Class for interacting with GitHub repositories"""
7
-
8
- def __init__(self, owner: str, repo: str):
9
- """
10
- Initialize repository client
11
-
12
- Args:
13
- owner: Repository owner
14
- repo: Repository name
15
- """
16
- self.owner = owner
17
- self.repo = repo
18
- self.base_url = f"https://api.github.com/repos/{owner}/{repo}"
19
-
20
- def get_info(self) -> Dict[str, Any]:
21
- """Get basic repository information"""
22
- return request(self.base_url)
23
-
24
- def get_commits(self, page: int = 1, per_page: int = 30, sha: str = None) -> List[Dict[str, Any]]:
25
- """
26
- Get repository commits
27
-
28
- Args:
29
- page: Page number
30
- per_page: Items per page
31
- sha: SHA or branch name to start listing commits from
32
- """
33
- url = f"{self.base_url}/commits?page={page}&per_page={per_page}"
34
- if sha:
35
- url += f"&sha={sha}"
36
- return request(url)
37
-
38
- def get_commit(self, sha: str) -> Dict[str, Any]:
39
- """Get a specific commit details"""
40
- url = f"{self.base_url}/commits/{sha}"
41
- return request(url)
42
-
43
- def get_pull_requests(self, state: str = "all", page: int = 1, per_page: int = 30) -> List[Dict[str, Any]]:
44
- """
45
- Get repository pull requests
46
-
47
- Args:
48
- state: State of PRs to return (open/closed/all)
49
- page: Page number
50
- per_page: Items per page
51
- """
52
- url = f"{self.base_url}/pulls?state={state}&page={page}&per_page={per_page}"
53
- return request(url)
54
-
55
- def get_pull_request(self, pr_number: int) -> Dict[str, Any]:
56
- """Get specific pull request details"""
57
- url = f"{self.base_url}/pulls/{pr_number}"
58
- return request(url)
59
-
60
- def get_pull_request_commits(self, pr_number: int) -> List[Dict[str, Any]]:
61
- """Get commits in a specific pull request"""
62
- url = f"{self.base_url}/pulls/{pr_number}/commits"
63
- return request(url)
64
-
65
- def get_pull_request_files(self, pr_number: int) -> List[Dict[str, Any]]:
66
- """Get files changed in a specific pull request"""
67
- url = f"{self.base_url}/pulls/{pr_number}/files"
68
- return request(url)
69
-
70
- def get_issues(self, state: str = "all", page: int = 1, per_page: int = 30, labels: str = None) -> List[Dict[str, Any]]:
71
- """
72
- Get repository issues
73
-
74
- Args:
75
- state: State of issues to return (open/closed/all)
76
- page: Page number
77
- per_page: Items per page
78
- labels: Comma-separated list of label names
79
- """
80
- url = f"{self.base_url}/issues?state={state}&page={page}&per_page={per_page}"
81
- if labels:
82
- url += f"&labels={labels}"
83
- return request(url)
84
-
85
- def get_issue(self, issue_number: int) -> Dict[str, Any]:
86
- """Get specific issue details"""
87
- url = f"{self.base_url}/issues/{issue_number}"
88
- return request(url)
89
-
90
- def get_issue_comments(self, issue_number: int) -> List[Dict[str, Any]]:
91
- """Get comments on a specific issue"""
92
- url = f"{self.base_url}/issues/{issue_number}/comments"
93
- return request(url)
94
-
95
- def get_labels(self) -> List[Dict[str, Any]]:
96
- """Get repository labels"""
97
- url = f"{self.base_url}/labels"
98
- return request(url)
99
-
100
- def get_milestones(self, state: str = "all") -> List[Dict[str, Any]]:
101
- """Get repository milestones"""
102
- url = f"{self.base_url}/milestones?state={state}"
103
- return request(url)
104
-
105
- def get_contributors(self, page: int = 1, per_page: int = 30) -> List[Dict[str, Any]]:
106
- """Get repository contributors"""
107
- url = f"{self.base_url}/contributors?page={page}&per_page={per_page}"
108
- return request(url)
109
-
110
- def get_languages(self) -> Dict[str, int]:
111
- """Get repository language breakdown"""
112
- url = f"{self.base_url}/languages"
113
- return request(url)
114
-
115
- def get_teams(self) -> List[Dict[str, Any]]:
116
- """Get teams with access to repository"""
117
- url = f"{self.base_url}/teams"
118
- return request(url)
119
-
120
- def get_tags(self) -> List[Dict[str, Any]]:
121
- """Get repository tags"""
122
- url = f"{self.base_url}/tags"
123
- return request(url)
124
-
125
- def get_releases(self, page: int = 1, per_page: int = 30) -> List[Dict[str, Any]]:
126
- """Get repository releases"""
127
- url = f"{self.base_url}/releases?page={page}&per_page={per_page}"
128
- return request(url)
129
-
130
- def get_release(self, release_id: str) -> Dict[str, Any]:
131
- """Get specific release details"""
132
- url = f"{self.base_url}/releases/{release_id}"
133
- return request(url)
134
-
135
- def get_latest_release(self) -> Dict[str, Any]:
136
- """Get latest release"""
137
- url = f"{self.base_url}/releases/latest"
138
- return request(url)
139
-
140
- def get_branches(self, page: int = 1, per_page: int = 30) -> List[Dict[str, Any]]:
141
- """Get repository branches"""
142
- url = f"{self.base_url}/branches?page={page}&per_page={per_page}"
143
- return request(url)
144
-
145
- def get_branch(self, branch: str) -> Dict[str, Any]:
146
- """Get specific branch details"""
147
- url = f"{self.base_url}/branches/{branch}"
148
- return request(url)
149
-
150
- def get_contents(self, path: str = "", ref: Optional[str] = None) -> Dict[str, Any]:
151
- """Get contents of file or directory"""
152
- url = f"{self.base_url}/contents/{quote(path)}"
153
- if ref:
154
- url += f"?ref={ref}"
155
- return request(url)
156
-
157
- def get_collaborators(self) -> List[Dict[str, Any]]:
158
- """Get repository collaborators"""
159
- url = f"{self.base_url}/collaborators"
160
- return request(url)
161
-
162
- def get_workflows(self) -> List[Dict[str, Any]]:
163
- """Get repository GitHub Actions workflows"""
164
- url = f"{self.base_url}/actions/workflows"
165
- return request(url)
166
-
167
- def get_workflow_runs(self, workflow_id: str) -> List[Dict[str, Any]]:
168
- """Get workflow runs for a specific workflow"""
169
- url = f"{self.base_url}/actions/workflows/{workflow_id}/runs"
170
- return request(url)
171
-
172
- def get_deployments(self) -> List[Dict[str, Any]]:
173
- """Get repository deployments"""
174
- url = f"{self.base_url}/deployments"
175
- return request(url)
176
-
177
- def get_traffic(self) -> Dict[str, Any]:
178
- """Get repository traffic data"""
179
- url = f"{self.base_url}/traffic/views"
180
- return request(url)
181
-
182
- def get_code_frequency(self) -> List[List[int]]:
183
- """Get weekly commit activity"""
184
- url = f"{self.base_url}/stats/code_frequency"
185
- return request(url)
186
-
187
- def get_commit_activity(self) -> List[Dict[str, Any]]:
188
- """Get last year of commit activity"""
189
- url = f"{self.base_url}/stats/commit_activity"
190
- return request(url)
191
-
192
- def get_community_profile(self) -> Dict[str, Any]:
193
- """Get community profile metrics"""
194
- url = f"{self.base_url}/community/profile"
195
- return request(url)