webscout 6.5__py3-none-any.whl → 6.6__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.
- webscout/Extra/autocoder/autocoder_utiles.py +119 -101
- webscout/Provider/AISEARCH/__init__.py +2 -0
- webscout/Provider/AISEARCH/ooai.py +155 -0
- webscout/Provider/Amigo.py +70 -85
- webscout/Provider/{prefind.py → Jadve.py} +72 -70
- webscout/Provider/Netwrck.py +235 -0
- webscout/Provider/Openai.py +4 -3
- webscout/Provider/PI.py +2 -2
- webscout/Provider/PizzaGPT.py +3 -3
- webscout/Provider/TeachAnything.py +15 -2
- webscout/Provider/Youchat.py +42 -8
- webscout/Provider/__init__.py +134 -147
- webscout/Provider/multichat.py +230 -0
- webscout/Provider/promptrefine.py +2 -2
- webscout/Provider/talkai.py +10 -13
- webscout/Provider/turboseek.py +5 -4
- webscout/Provider/tutorai.py +8 -112
- webscout/Provider/typegpt.py +4 -5
- webscout/Provider/x0gpt.py +81 -9
- webscout/Provider/yep.py +123 -361
- webscout/__init__.py +10 -1
- webscout/conversation.py +24 -9
- webscout/exceptions.py +188 -20
- webscout/litprinter/__init__.py +4 -117
- webscout/litprinter/colors.py +54 -0
- webscout/optimizers.py +335 -185
- webscout/scout/__init__.py +2 -5
- webscout/scout/core/__init__.py +7 -0
- webscout/scout/core/crawler.py +140 -0
- webscout/scout/core/scout.py +571 -0
- webscout/scout/core/search_result.py +96 -0
- webscout/scout/core/text_analyzer.py +63 -0
- webscout/scout/core/text_utils.py +277 -0
- webscout/scout/core/web_analyzer.py +52 -0
- webscout/scout/element.py +6 -5
- webscout/update_checker.py +117 -58
- webscout/version.py +1 -1
- webscout/zeroart/base.py +15 -16
- webscout/zeroart/effects.py +1 -1
- webscout/zeroart/fonts.py +1 -1
- {webscout-6.5.dist-info → webscout-6.6.dist-info}/METADATA +8 -165
- {webscout-6.5.dist-info → webscout-6.6.dist-info}/RECORD +59 -41
- webscout-6.6.dist-info/top_level.txt +2 -0
- webstoken/__init__.py +30 -0
- webstoken/classifier.py +189 -0
- webstoken/keywords.py +216 -0
- webstoken/language.py +128 -0
- webstoken/ner.py +164 -0
- webstoken/normalizer.py +35 -0
- webstoken/processor.py +77 -0
- webstoken/sentiment.py +206 -0
- webstoken/stemmer.py +73 -0
- webstoken/t.py +75 -0
- webstoken/tagger.py +60 -0
- webstoken/tokenizer.py +158 -0
- webscout/Provider/Perplexity.py +0 -591
- webscout/Provider/RoboCoders.py +0 -206
- webscout/Provider/genspark.py +0 -225
- webscout/Provider/perplexitylabs.py +0 -265
- webscout/Provider/twitterclone.py +0 -251
- webscout/Provider/upstage.py +0 -230
- webscout-6.5.dist-info/top_level.txt +0 -1
- /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
- {webscout-6.5.dist-info → webscout-6.6.dist-info}/LICENSE.md +0 -0
- {webscout-6.5.dist-info → webscout-6.6.dist-info}/WHEEL +0 -0
- {webscout-6.5.dist-info → webscout-6.6.dist-info}/entry_points.txt +0 -0
webscout/exceptions.py
CHANGED
|
@@ -1,48 +1,117 @@
|
|
|
1
|
+
WATCH_URL = 'https://www.youtube.com/watch?v={video_id}'
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
class WebscoutE(Exception):
|
|
2
|
-
"""
|
|
5
|
+
"""
|
|
6
|
+
Base exception class for all Webscout related errors.
|
|
7
|
+
|
|
8
|
+
This class serves as the root for all custom exceptions raised by the Webscout library.
|
|
9
|
+
It provides a common base for catching and handling errors specific to Webscout.
|
|
10
|
+
"""
|
|
11
|
+
pass
|
|
3
12
|
|
|
4
13
|
|
|
5
14
|
class APIConnectionError(Exception):
|
|
6
|
-
"""
|
|
15
|
+
"""
|
|
16
|
+
Exception raised when there are issues connecting to an API.
|
|
17
|
+
|
|
18
|
+
This exception is raised when a network connection to an external API fails.
|
|
19
|
+
It indicates a problem with the network or the API server itself.
|
|
20
|
+
"""
|
|
7
21
|
pass
|
|
8
22
|
|
|
9
23
|
|
|
10
24
|
class RatelimitE(Exception):
|
|
11
|
-
"""
|
|
25
|
+
"""
|
|
26
|
+
Exception raised when an API rate limit is exceeded.
|
|
27
|
+
|
|
28
|
+
This exception is raised when the number of requests to an API exceeds the allowed limit within a given time frame.
|
|
29
|
+
It indicates that the application is making too many requests and needs to slow down.
|
|
30
|
+
"""
|
|
31
|
+
pass
|
|
12
32
|
|
|
13
33
|
|
|
14
34
|
class ConversationLimitException(Exception):
|
|
15
|
-
"""
|
|
35
|
+
"""
|
|
36
|
+
Exception raised when a conversation limit is exceeded.
|
|
37
|
+
|
|
38
|
+
This exception is raised when a limit on the number of turns or messages in a conversation is exceeded.
|
|
39
|
+
It indicates that the conversation has reached its maximum allowed length.
|
|
40
|
+
"""
|
|
16
41
|
pass
|
|
17
42
|
|
|
18
43
|
|
|
19
44
|
class TimeoutE(Exception):
|
|
20
|
-
"""
|
|
45
|
+
"""
|
|
46
|
+
Exception raised when a request to an API times out.
|
|
47
|
+
|
|
48
|
+
This exception is raised when a request to an API takes longer than the allowed time to complete.
|
|
49
|
+
It indicates a problem with the network or the API server being slow to respond.
|
|
50
|
+
"""
|
|
51
|
+
pass
|
|
21
52
|
|
|
22
53
|
|
|
23
54
|
class FailedToGenerateResponseError(Exception):
|
|
24
|
-
"""
|
|
55
|
+
"""
|
|
56
|
+
Exception raised when a provider fails to generate a response.
|
|
57
|
+
|
|
58
|
+
This exception is raised when a provider is unable to generate a response for a given request.
|
|
59
|
+
It indicates an issue with the provider's logic or data.
|
|
60
|
+
"""
|
|
61
|
+
pass
|
|
25
62
|
|
|
26
63
|
|
|
27
64
|
class AllProvidersFailure(Exception):
|
|
28
|
-
"""
|
|
65
|
+
"""
|
|
66
|
+
Exception raised when all providers fail to generate a response.
|
|
67
|
+
|
|
68
|
+
This exception is raised when none of the available providers are able to generate a response for a given request.
|
|
69
|
+
It indicates a widespread issue with all providers.
|
|
70
|
+
"""
|
|
29
71
|
pass
|
|
30
72
|
|
|
31
73
|
|
|
32
74
|
class FacebookInvalidCredentialsException(Exception):
|
|
75
|
+
"""
|
|
76
|
+
Exception raised when Facebook credentials are invalid.
|
|
77
|
+
|
|
78
|
+
This exception is raised when the provided Facebook credentials (e.g., username, password, cookies) are invalid.
|
|
79
|
+
It indicates that the application is unable to authenticate with Facebook.
|
|
80
|
+
"""
|
|
33
81
|
pass
|
|
34
82
|
|
|
35
83
|
|
|
36
84
|
class FacebookRegionBlocked(Exception):
|
|
85
|
+
"""
|
|
86
|
+
Exception raised when Facebook access is blocked due to region restrictions.
|
|
87
|
+
|
|
88
|
+
This exception is raised when access to Facebook is blocked due to geographical restrictions.
|
|
89
|
+
It indicates that the application is unable to access Facebook from the current location.
|
|
90
|
+
"""
|
|
37
91
|
pass
|
|
38
92
|
|
|
39
93
|
|
|
40
94
|
class ModelUnloadedException(Exception):
|
|
95
|
+
"""
|
|
96
|
+
Exception raised when a model is unloaded.
|
|
97
|
+
|
|
98
|
+
This exception is raised when a required model is not loaded or has been unloaded.
|
|
99
|
+
It indicates that the application is unable to perform operations that require the model.
|
|
100
|
+
"""
|
|
41
101
|
pass
|
|
42
102
|
|
|
43
103
|
|
|
44
104
|
class TranscriptRetrievalError(WebscoutE):
|
|
45
|
-
"""
|
|
105
|
+
"""
|
|
106
|
+
Base class for transcript retrieval errors.
|
|
107
|
+
|
|
108
|
+
This class serves as the root for all custom exceptions related to transcript retrieval.
|
|
109
|
+
It provides a common base for catching and handling errors specific to transcript retrieval.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
video_id (str): The ID of the video for which the transcript retrieval failed.
|
|
113
|
+
message (str): A message describing the error.
|
|
114
|
+
"""
|
|
46
115
|
|
|
47
116
|
def __init__(self, video_id, message):
|
|
48
117
|
super().__init__(message.format(video_url=WATCH_URL.format(video_id=video_id)))
|
|
@@ -50,7 +119,16 @@ class TranscriptRetrievalError(WebscoutE):
|
|
|
50
119
|
|
|
51
120
|
|
|
52
121
|
class YouTubeRequestFailedError(TranscriptRetrievalError):
|
|
53
|
-
"""
|
|
122
|
+
"""
|
|
123
|
+
Exception raised when a request to YouTube fails.
|
|
124
|
+
|
|
125
|
+
This exception is raised when a network request to YouTube fails.
|
|
126
|
+
It indicates a problem with the network or the YouTube server itself.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
video_id (str): The ID of the video for which the request failed.
|
|
130
|
+
http_error (str): The HTTP error that occurred.
|
|
131
|
+
"""
|
|
54
132
|
|
|
55
133
|
def __init__(self, video_id, http_error):
|
|
56
134
|
message = 'Request to YouTube failed: {reason}'
|
|
@@ -58,7 +136,15 @@ class YouTubeRequestFailedError(TranscriptRetrievalError):
|
|
|
58
136
|
|
|
59
137
|
|
|
60
138
|
class VideoUnavailableError(TranscriptRetrievalError):
|
|
61
|
-
"""
|
|
139
|
+
"""
|
|
140
|
+
Exception raised when the video is unavailable.
|
|
141
|
+
|
|
142
|
+
This exception is raised when the requested video is no longer available on YouTube.
|
|
143
|
+
It indicates that the video has been removed or made private.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
video_id (str): The ID of the unavailable video.
|
|
147
|
+
"""
|
|
62
148
|
|
|
63
149
|
def __init__(self, video_id):
|
|
64
150
|
message = 'The video is no longer available'
|
|
@@ -66,7 +152,15 @@ class VideoUnavailableError(TranscriptRetrievalError):
|
|
|
66
152
|
|
|
67
153
|
|
|
68
154
|
class InvalidVideoIdError(TranscriptRetrievalError):
|
|
69
|
-
"""
|
|
155
|
+
"""
|
|
156
|
+
Exception raised when an invalid video ID is provided.
|
|
157
|
+
|
|
158
|
+
This exception is raised when the provided video ID is not in the correct format.
|
|
159
|
+
It indicates that the application is using a URL instead of the video ID.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
video_id (str): The invalid video ID.
|
|
163
|
+
"""
|
|
70
164
|
|
|
71
165
|
def __init__(self, video_id):
|
|
72
166
|
message = (
|
|
@@ -78,7 +172,15 @@ class InvalidVideoIdError(TranscriptRetrievalError):
|
|
|
78
172
|
|
|
79
173
|
|
|
80
174
|
class TooManyRequestsError(TranscriptRetrievalError):
|
|
81
|
-
"""
|
|
175
|
+
"""
|
|
176
|
+
Exception raised when YouTube rate limits the requests.
|
|
177
|
+
|
|
178
|
+
This exception is raised when YouTube rate limits the requests from the current IP address.
|
|
179
|
+
It indicates that the application is making too many requests and needs to slow down or use a different IP.
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
video_id (str): The ID of the video for which the request was rate-limited.
|
|
183
|
+
"""
|
|
82
184
|
|
|
83
185
|
def __init__(self, video_id):
|
|
84
186
|
message = (
|
|
@@ -92,7 +194,15 @@ class TooManyRequestsError(TranscriptRetrievalError):
|
|
|
92
194
|
|
|
93
195
|
|
|
94
196
|
class TranscriptsDisabledError(TranscriptRetrievalError):
|
|
95
|
-
"""
|
|
197
|
+
"""
|
|
198
|
+
Exception raised when transcripts are disabled for the video.
|
|
199
|
+
|
|
200
|
+
This exception is raised when the video has subtitles disabled.
|
|
201
|
+
It indicates that the application cannot retrieve transcripts for this video.
|
|
202
|
+
|
|
203
|
+
Args:
|
|
204
|
+
video_id (str): The ID of the video with disabled transcripts.
|
|
205
|
+
"""
|
|
96
206
|
|
|
97
207
|
def __init__(self, video_id):
|
|
98
208
|
message = 'Subtitles are disabled for this video'
|
|
@@ -100,7 +210,15 @@ class TranscriptsDisabledError(TranscriptRetrievalError):
|
|
|
100
210
|
|
|
101
211
|
|
|
102
212
|
class NoTranscriptAvailableError(TranscriptRetrievalError):
|
|
103
|
-
"""
|
|
213
|
+
"""
|
|
214
|
+
Exception raised when no transcripts are available for the video.
|
|
215
|
+
|
|
216
|
+
This exception is raised when the video has no transcripts available.
|
|
217
|
+
It indicates that the application cannot retrieve transcripts for this video.
|
|
218
|
+
|
|
219
|
+
Args:
|
|
220
|
+
video_id (str): The ID of the video with no available transcripts.
|
|
221
|
+
"""
|
|
104
222
|
|
|
105
223
|
def __init__(self, video_id):
|
|
106
224
|
message = 'No transcripts are available for this video'
|
|
@@ -108,7 +226,15 @@ class NoTranscriptAvailableError(TranscriptRetrievalError):
|
|
|
108
226
|
|
|
109
227
|
|
|
110
228
|
class NotTranslatableError(TranscriptRetrievalError):
|
|
111
|
-
"""
|
|
229
|
+
"""
|
|
230
|
+
Exception raised when the transcript is not translatable.
|
|
231
|
+
|
|
232
|
+
This exception is raised when the requested language is not translatable.
|
|
233
|
+
It indicates that the application cannot translate the transcript to the requested language.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
video_id (str): The ID of the video with a non-translatable transcript.
|
|
237
|
+
"""
|
|
112
238
|
|
|
113
239
|
def __init__(self, video_id):
|
|
114
240
|
message = 'The requested language is not translatable'
|
|
@@ -116,7 +242,15 @@ class NotTranslatableError(TranscriptRetrievalError):
|
|
|
116
242
|
|
|
117
243
|
|
|
118
244
|
class TranslationLanguageNotAvailableError(TranscriptRetrievalError):
|
|
119
|
-
"""
|
|
245
|
+
"""
|
|
246
|
+
Exception raised when the requested translation language is not available.
|
|
247
|
+
|
|
248
|
+
This exception is raised when the requested translation language is not supported for the transcript.
|
|
249
|
+
It indicates that the application cannot translate the transcript to the requested language.
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
video_id (str): The ID of the video for which the translation language is not available.
|
|
253
|
+
"""
|
|
120
254
|
|
|
121
255
|
def __init__(self, video_id):
|
|
122
256
|
message = 'The requested translation language is not available'
|
|
@@ -124,7 +258,15 @@ class TranslationLanguageNotAvailableError(TranscriptRetrievalError):
|
|
|
124
258
|
|
|
125
259
|
|
|
126
260
|
class CookiePathInvalidError(TranscriptRetrievalError):
|
|
127
|
-
"""
|
|
261
|
+
"""
|
|
262
|
+
Exception raised when the cookie path is invalid.
|
|
263
|
+
|
|
264
|
+
This exception is raised when the provided cookie path is invalid.
|
|
265
|
+
It indicates that the application cannot access the cookie file.
|
|
266
|
+
|
|
267
|
+
Args:
|
|
268
|
+
video_id (str): The ID of the video for which the cookie path is invalid.
|
|
269
|
+
"""
|
|
128
270
|
|
|
129
271
|
def __init__(self, video_id):
|
|
130
272
|
message = 'The provided cookie path is invalid'
|
|
@@ -132,7 +274,15 @@ class CookiePathInvalidError(TranscriptRetrievalError):
|
|
|
132
274
|
|
|
133
275
|
|
|
134
276
|
class CookiesInvalidError(TranscriptRetrievalError):
|
|
135
|
-
"""
|
|
277
|
+
"""
|
|
278
|
+
Exception raised when the provided cookies are invalid.
|
|
279
|
+
|
|
280
|
+
This exception is raised when the provided cookies are not valid or have expired.
|
|
281
|
+
It indicates that the application cannot authenticate with YouTube using the provided cookies.
|
|
282
|
+
|
|
283
|
+
Args:
|
|
284
|
+
video_id (str): The ID of the video for which the cookies are invalid.
|
|
285
|
+
"""
|
|
136
286
|
|
|
137
287
|
def __init__(self, video_id):
|
|
138
288
|
message = 'The cookies provided are not valid (may have expired)'
|
|
@@ -140,7 +290,15 @@ class CookiesInvalidError(TranscriptRetrievalError):
|
|
|
140
290
|
|
|
141
291
|
|
|
142
292
|
class FailedToCreateConsentCookieError(TranscriptRetrievalError):
|
|
143
|
-
"""
|
|
293
|
+
"""
|
|
294
|
+
Exception raised when consent cookie creation fails.
|
|
295
|
+
|
|
296
|
+
This exception is raised when the application fails to automatically give consent to saving cookies.
|
|
297
|
+
It indicates that the application cannot proceed without the consent cookie.
|
|
298
|
+
|
|
299
|
+
Args:
|
|
300
|
+
video_id (str): The ID of the video for which the consent cookie creation failed.
|
|
301
|
+
"""
|
|
144
302
|
|
|
145
303
|
def __init__(self, video_id):
|
|
146
304
|
message = 'Failed to automatically give consent to saving cookies'
|
|
@@ -148,7 +306,17 @@ class FailedToCreateConsentCookieError(TranscriptRetrievalError):
|
|
|
148
306
|
|
|
149
307
|
|
|
150
308
|
class NoTranscriptFoundError(TranscriptRetrievalError):
|
|
151
|
-
"""
|
|
309
|
+
"""
|
|
310
|
+
Exception raised when no transcript is found for the requested language codes.
|
|
311
|
+
|
|
312
|
+
This exception is raised when no transcripts are found for any of the requested language codes.
|
|
313
|
+
It indicates that the application cannot retrieve transcripts for the requested languages.
|
|
314
|
+
|
|
315
|
+
Args:
|
|
316
|
+
video_id (str): The ID of the video for which no transcript was found.
|
|
317
|
+
requested_language_codes (list): The list of requested language codes.
|
|
318
|
+
transcript_data (dict): The transcript data that was found.
|
|
319
|
+
"""
|
|
152
320
|
|
|
153
321
|
def __init__(self, video_id, requested_language_codes, transcript_data):
|
|
154
322
|
message = (
|
webscout/litprinter/__init__.py
CHANGED
|
@@ -68,6 +68,8 @@ import textwrap
|
|
|
68
68
|
from collections import defaultdict
|
|
69
69
|
import shutil
|
|
70
70
|
import inspect
|
|
71
|
+
from .colors import Colors
|
|
72
|
+
|
|
71
73
|
try:
|
|
72
74
|
from pygments import highlight
|
|
73
75
|
from pygments.lexers import get_lexer_by_name
|
|
@@ -89,60 +91,7 @@ if os.name == 'nt':
|
|
|
89
91
|
kernel32 = ctypes.windll.kernel32
|
|
90
92
|
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
|
|
91
93
|
|
|
92
|
-
#
|
|
93
|
-
class Colors:
|
|
94
|
-
"""ANSI color codes for terminal output."""
|
|
95
|
-
# Base colors
|
|
96
|
-
BLACK = '\033[30m'
|
|
97
|
-
RED = '\033[31m'
|
|
98
|
-
GREEN = '\033[32m'
|
|
99
|
-
YELLOW = '\033[33m'
|
|
100
|
-
BLUE = '\033[34m'
|
|
101
|
-
MAGENTA = '\033[35m'
|
|
102
|
-
CYAN = '\033[36m'
|
|
103
|
-
WHITE = '\033[37m'
|
|
104
|
-
GRAY = '\033[90m'
|
|
105
|
-
|
|
106
|
-
# Bright colors
|
|
107
|
-
BRIGHT_BLACK = '\033[90m'
|
|
108
|
-
BRIGHT_RED = '\033[91m'
|
|
109
|
-
BRIGHT_GREEN = '\033[92m'
|
|
110
|
-
BRIGHT_YELLOW = '\033[93m'
|
|
111
|
-
BRIGHT_BLUE = '\033[94m'
|
|
112
|
-
BRIGHT_MAGENTA = '\033[95m'
|
|
113
|
-
BRIGHT_CYAN = '\033[96m'
|
|
114
|
-
BRIGHT_WHITE = '\033[97m'
|
|
115
|
-
|
|
116
|
-
# Background colors
|
|
117
|
-
BG_BLACK = '\033[40m'
|
|
118
|
-
BG_RED = '\033[41m'
|
|
119
|
-
BG_GREEN = '\033[42m'
|
|
120
|
-
BG_YELLOW = '\033[43m'
|
|
121
|
-
BG_BLUE = '\033[44m'
|
|
122
|
-
BG_MAGENTA = '\033[45m'
|
|
123
|
-
BG_CYAN = '\033[46m'
|
|
124
|
-
BG_WHITE = '\033[47m'
|
|
125
|
-
|
|
126
|
-
# Styles
|
|
127
|
-
BOLD = '\033[1m'
|
|
128
|
-
DIM = '\033[2m'
|
|
129
|
-
ITALIC = '\033[3m'
|
|
130
|
-
UNDERLINE = '\033[4m'
|
|
131
|
-
BLINK = '\033[5m'
|
|
132
|
-
REVERSE = '\033[7m'
|
|
133
|
-
STRIKE = '\033[9m'
|
|
134
|
-
HIDDEN = '\033[8m'
|
|
135
|
-
|
|
136
|
-
# Special
|
|
137
|
-
RESET = '\033[0m'
|
|
138
|
-
CLEAR_SCREEN = '\033[2J'
|
|
139
|
-
CLEAR_LINE = '\033[2K'
|
|
140
|
-
|
|
141
|
-
# Cursor movement
|
|
142
|
-
UP = '\033[1A'
|
|
143
|
-
DOWN = '\033[1B'
|
|
144
|
-
RIGHT = '\033[1C'
|
|
145
|
-
LEFT = '\033[1D'
|
|
94
|
+
# Removed the duplicated Colors class to import from colors.py
|
|
146
95
|
|
|
147
96
|
class SyntaxTheme:
|
|
148
97
|
"""Syntax highlighting theme."""
|
|
@@ -767,66 +716,4 @@ class LitPrinter:
|
|
|
767
716
|
"""Clear the current line."""
|
|
768
717
|
print('\r' + ' ' * self._get_terminal_width(), end='\r', file=self.file, flush=True)
|
|
769
718
|
|
|
770
|
-
|
|
771
|
-
if __name__ == "__main__":
|
|
772
|
-
printer = LitPrinter()
|
|
773
|
-
|
|
774
|
-
printer.banner("Welcome to the LitPrinter Demo! ")
|
|
775
|
-
|
|
776
|
-
printer.status("Loading that heat... ")
|
|
777
|
-
time.sleep(1)
|
|
778
|
-
printer.status("Almost ready to drop... ")
|
|
779
|
-
time.sleep(1)
|
|
780
|
-
printer.status("")
|
|
781
|
-
|
|
782
|
-
printer.success("Ayy, we made it! ")
|
|
783
|
-
printer.error("Houston, we got a problem! ")
|
|
784
|
-
printer.warning("Hold up, something sus... ")
|
|
785
|
-
printer.info("Just so you know fam... ")
|
|
786
|
-
|
|
787
|
-
headers = ["Name", "Vibe", "Energy"]
|
|
788
|
-
rows = [
|
|
789
|
-
["Python", "Immaculate", "100%"],
|
|
790
|
-
["Java", "Decent", "75%"],
|
|
791
|
-
["C++", "Complex", "85%"]
|
|
792
|
-
]
|
|
793
|
-
printer.table(headers, rows)
|
|
794
|
-
|
|
795
|
-
data = {
|
|
796
|
-
"squad": {
|
|
797
|
-
"python": {"vibe": "lit", "power": "over 9000"},
|
|
798
|
-
"javascript": {"vibe": "cool", "power": "8000"}
|
|
799
|
-
},
|
|
800
|
-
"config": {
|
|
801
|
-
"mode": "beast",
|
|
802
|
-
"activated": True
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
printer.tree(data)
|
|
806
|
-
|
|
807
|
-
printer.json(data)
|
|
808
|
-
|
|
809
|
-
code = '''def print_drip():
|
|
810
|
-
# This function brings the heat
|
|
811
|
-
print("Straight bussin!")
|
|
812
|
-
return True # No cap'''
|
|
813
|
-
printer.code_block(code)
|
|
814
|
-
|
|
815
|
-
printer.print("Basic text but make it fancy ")
|
|
816
|
-
printer.print("Colors go hard", style=Colors.GREEN)
|
|
817
|
-
printer.print("Bold & Blue = Different breed", style=Colors.BLUE + Colors.BOLD)
|
|
818
|
-
|
|
819
|
-
markdown_text = """# Main Title (Straight Fire)
|
|
820
|
-
## Subtitle (Also Heat)
|
|
821
|
-
- First thing's first
|
|
822
|
-
- Second thing's second
|
|
823
|
-
**Bold moves** and *smooth style*
|
|
824
|
-
"""
|
|
825
|
-
printer.print(markdown_text, markdown=True)
|
|
826
|
-
|
|
827
|
-
test_dict = {
|
|
828
|
-
"name": "LitPrinter",
|
|
829
|
-
"vibes": ["immaculate", "unmatched", "different"],
|
|
830
|
-
"config": {"mode": "beast", "level": "over 9000"}
|
|
831
|
-
}
|
|
832
|
-
printer.print(test_dict)
|
|
719
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
class Colors:
|
|
2
|
+
"""ANSI color codes for terminal output."""
|
|
3
|
+
# Base colors
|
|
4
|
+
BLACK = '\033[30m'
|
|
5
|
+
RED = '\033[31m'
|
|
6
|
+
GREEN = '\033[32m'
|
|
7
|
+
YELLOW = '\033[33m'
|
|
8
|
+
BLUE = '\033[34m'
|
|
9
|
+
MAGENTA = '\033[35m'
|
|
10
|
+
CYAN = '\033[36m'
|
|
11
|
+
WHITE = '\033[37m'
|
|
12
|
+
GRAY = '\033[90m'
|
|
13
|
+
|
|
14
|
+
# Bright colors
|
|
15
|
+
BRIGHT_BLACK = '\033[90m'
|
|
16
|
+
BRIGHT_RED = '\033[91m'
|
|
17
|
+
BRIGHT_GREEN = '\033[92m'
|
|
18
|
+
BRIGHT_YELLOW = '\033[93m'
|
|
19
|
+
BRIGHT_BLUE = '\033[94m'
|
|
20
|
+
BRIGHT_MAGENTA = '\033[95m'
|
|
21
|
+
BRIGHT_CYAN = '\033[96m'
|
|
22
|
+
BRIGHT_WHITE = '\033[97m'
|
|
23
|
+
|
|
24
|
+
# Background colors
|
|
25
|
+
BG_BLACK = '\033[40m'
|
|
26
|
+
BG_RED = '\033[41m'
|
|
27
|
+
BG_GREEN = '\033[42m'
|
|
28
|
+
BG_YELLOW = '\033[43m'
|
|
29
|
+
BG_BLUE = '\033[44m'
|
|
30
|
+
BG_MAGENTA = '\033[45m'
|
|
31
|
+
BG_CYAN = '\033[46m'
|
|
32
|
+
BG_WHITE = '\033[47m'
|
|
33
|
+
|
|
34
|
+
# Styles
|
|
35
|
+
BOLD = '\033[1m'
|
|
36
|
+
DIM = '\033[2m'
|
|
37
|
+
ITALIC = '\033[3m'
|
|
38
|
+
UNDERLINE = '\033[4m'
|
|
39
|
+
BLINK = '\033[5m'
|
|
40
|
+
REVERSE = '\033[7m'
|
|
41
|
+
STRIKE = '\033[9m'
|
|
42
|
+
HIDDEN = '\033[8m'
|
|
43
|
+
|
|
44
|
+
# Special
|
|
45
|
+
RESET = '\033[0m'
|
|
46
|
+
CLEAR_SCREEN = '\033[2J'
|
|
47
|
+
CLEAR_LINE = '\033[2K'
|
|
48
|
+
|
|
49
|
+
# Cursor movement
|
|
50
|
+
UP = '\033[1A'
|
|
51
|
+
DOWN = '\033[1B'
|
|
52
|
+
RIGHT = '\033[1C'
|
|
53
|
+
LEFT = '\033[1D'
|
|
54
|
+
|