webscout 8.2.6__py3-none-any.whl → 8.2.8__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/AIauto.py +1 -1
- webscout/AIutel.py +298 -239
- webscout/Extra/Act.md +309 -0
- webscout/Extra/GitToolkit/gitapi/README.md +110 -0
- webscout/Extra/YTToolkit/README.md +375 -0
- webscout/Extra/YTToolkit/ytapi/README.md +44 -0
- webscout/Extra/YTToolkit/ytapi/extras.py +92 -19
- webscout/Extra/autocoder/autocoder.py +309 -114
- webscout/Extra/autocoder/autocoder_utiles.py +15 -15
- webscout/Extra/gguf.md +430 -0
- webscout/Extra/tempmail/README.md +488 -0
- webscout/Extra/weather.md +281 -0
- webscout/Litlogger/Readme.md +175 -0
- webscout/Provider/AISEARCH/DeepFind.py +41 -37
- webscout/Provider/AISEARCH/README.md +279 -0
- webscout/Provider/AISEARCH/__init__.py +0 -1
- webscout/Provider/AISEARCH/genspark_search.py +228 -86
- webscout/Provider/AISEARCH/hika_search.py +11 -11
- webscout/Provider/AISEARCH/scira_search.py +324 -322
- webscout/Provider/AllenAI.py +7 -14
- webscout/Provider/Blackboxai.py +518 -74
- webscout/Provider/Cloudflare.py +0 -1
- webscout/Provider/Deepinfra.py +23 -21
- webscout/Provider/Flowith.py +217 -0
- webscout/Provider/FreeGemini.py +250 -0
- webscout/Provider/GizAI.py +15 -5
- webscout/Provider/Glider.py +11 -8
- webscout/Provider/HeckAI.py +80 -52
- webscout/Provider/Koboldai.py +7 -4
- webscout/Provider/LambdaChat.py +2 -2
- webscout/Provider/Marcus.py +10 -18
- webscout/Provider/OPENAI/BLACKBOXAI.py +735 -0
- webscout/Provider/OPENAI/Cloudflare.py +378 -0
- webscout/Provider/OPENAI/FreeGemini.py +282 -0
- webscout/Provider/OPENAI/NEMOTRON.py +244 -0
- webscout/Provider/OPENAI/README.md +1253 -0
- webscout/Provider/OPENAI/__init__.py +8 -0
- webscout/Provider/OPENAI/ai4chat.py +293 -286
- webscout/Provider/OPENAI/api.py +810 -0
- webscout/Provider/OPENAI/base.py +217 -14
- webscout/Provider/OPENAI/c4ai.py +373 -367
- webscout/Provider/OPENAI/chatgpt.py +7 -0
- webscout/Provider/OPENAI/chatgptclone.py +7 -0
- webscout/Provider/OPENAI/chatsandbox.py +172 -0
- webscout/Provider/OPENAI/deepinfra.py +30 -20
- webscout/Provider/OPENAI/e2b.py +6 -0
- webscout/Provider/OPENAI/exaai.py +7 -0
- webscout/Provider/OPENAI/exachat.py +6 -0
- webscout/Provider/OPENAI/flowith.py +162 -0
- webscout/Provider/OPENAI/freeaichat.py +359 -352
- webscout/Provider/OPENAI/glider.py +323 -316
- webscout/Provider/OPENAI/groq.py +361 -354
- webscout/Provider/OPENAI/heckai.py +30 -64
- webscout/Provider/OPENAI/llmchatco.py +8 -0
- webscout/Provider/OPENAI/mcpcore.py +7 -0
- webscout/Provider/OPENAI/multichat.py +8 -0
- webscout/Provider/OPENAI/netwrck.py +356 -350
- webscout/Provider/OPENAI/opkfc.py +8 -0
- webscout/Provider/OPENAI/scirachat.py +471 -462
- webscout/Provider/OPENAI/sonus.py +9 -0
- webscout/Provider/OPENAI/standardinput.py +9 -1
- webscout/Provider/OPENAI/textpollinations.py +339 -329
- webscout/Provider/OPENAI/toolbaz.py +7 -0
- webscout/Provider/OPENAI/typefully.py +355 -0
- webscout/Provider/OPENAI/typegpt.py +358 -346
- webscout/Provider/OPENAI/uncovrAI.py +7 -0
- webscout/Provider/OPENAI/utils.py +103 -7
- webscout/Provider/OPENAI/venice.py +12 -0
- webscout/Provider/OPENAI/wisecat.py +19 -19
- webscout/Provider/OPENAI/writecream.py +7 -0
- webscout/Provider/OPENAI/x0gpt.py +7 -0
- webscout/Provider/OPENAI/yep.py +50 -21
- webscout/Provider/OpenGPT.py +1 -1
- webscout/Provider/TTI/AiForce/README.md +159 -0
- webscout/Provider/TTI/FreeAIPlayground/README.md +99 -0
- webscout/Provider/TTI/ImgSys/README.md +174 -0
- webscout/Provider/TTI/MagicStudio/README.md +101 -0
- webscout/Provider/TTI/Nexra/README.md +155 -0
- webscout/Provider/TTI/PollinationsAI/README.md +146 -0
- webscout/Provider/TTI/README.md +128 -0
- webscout/Provider/TTI/aiarta/README.md +134 -0
- webscout/Provider/TTI/artbit/README.md +100 -0
- webscout/Provider/TTI/fastflux/README.md +129 -0
- webscout/Provider/TTI/huggingface/README.md +114 -0
- webscout/Provider/TTI/piclumen/README.md +161 -0
- webscout/Provider/TTI/pixelmuse/README.md +79 -0
- webscout/Provider/TTI/talkai/README.md +139 -0
- webscout/Provider/TTS/README.md +192 -0
- webscout/Provider/TTS/__init__.py +2 -1
- webscout/Provider/TTS/speechma.py +500 -100
- webscout/Provider/TTS/sthir.py +94 -0
- webscout/Provider/TeachAnything.py +3 -7
- webscout/Provider/TextPollinationsAI.py +4 -2
- webscout/Provider/{aimathgpt.py → UNFINISHED/ChatHub.py} +88 -68
- webscout/Provider/UNFINISHED/liner_api_request.py +263 -0
- webscout/Provider/UNFINISHED/oivscode.py +351 -0
- webscout/Provider/UNFINISHED/test_lmarena.py +119 -0
- webscout/Provider/Writecream.py +11 -2
- webscout/Provider/__init__.py +8 -14
- webscout/Provider/ai4chat.py +4 -58
- webscout/Provider/asksteve.py +17 -9
- webscout/Provider/cerebras.py +3 -1
- webscout/Provider/koala.py +170 -268
- webscout/Provider/llmchat.py +3 -0
- webscout/Provider/lmarena.py +198 -0
- webscout/Provider/meta.py +7 -4
- webscout/Provider/samurai.py +223 -0
- webscout/Provider/scira_chat.py +4 -2
- webscout/Provider/typefully.py +23 -151
- webscout/__init__.py +4 -2
- webscout/cli.py +3 -28
- webscout/conversation.py +35 -35
- webscout/litagent/Readme.md +276 -0
- webscout/scout/README.md +402 -0
- webscout/swiftcli/Readme.md +323 -0
- webscout/version.py +1 -1
- webscout/webscout_search.py +2 -182
- webscout/webscout_search_async.py +1 -179
- webscout/zeroart/README.md +89 -0
- webscout/zeroart/__init__.py +134 -54
- webscout/zeroart/base.py +19 -13
- webscout/zeroart/effects.py +101 -99
- webscout/zeroart/fonts.py +1239 -816
- {webscout-8.2.6.dist-info → webscout-8.2.8.dist-info}/METADATA +116 -74
- {webscout-8.2.6.dist-info → webscout-8.2.8.dist-info}/RECORD +130 -103
- {webscout-8.2.6.dist-info → webscout-8.2.8.dist-info}/WHEEL +1 -1
- webscout-8.2.8.dist-info/entry_points.txt +3 -0
- webscout-8.2.8.dist-info/top_level.txt +1 -0
- webscout/Provider/AISEARCH/ISou.py +0 -256
- webscout/Provider/ElectronHub.py +0 -773
- webscout/Provider/Free2GPT.py +0 -241
- webscout/Provider/GPTWeb.py +0 -249
- webscout/Provider/bagoodex.py +0 -145
- webscout/Provider/geminiprorealtime.py +0 -160
- webscout/scout/core.py +0 -881
- webscout-8.2.6.dist-info/entry_points.txt +0 -3
- webscout-8.2.6.dist-info/top_level.txt +0 -2
- webstoken/__init__.py +0 -30
- webstoken/classifier.py +0 -189
- webstoken/keywords.py +0 -216
- webstoken/language.py +0 -128
- webstoken/ner.py +0 -164
- webstoken/normalizer.py +0 -35
- webstoken/processor.py +0 -77
- webstoken/sentiment.py +0 -206
- webstoken/stemmer.py +0 -73
- webstoken/tagger.py +0 -60
- webstoken/tokenizer.py +0 -158
- /webscout/Provider/{Youchat.py → UNFINISHED/Youchat.py} +0 -0
- {webscout-8.2.6.dist-info → webscout-8.2.8.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>☀️ Webscout Weather Toolkit</h1>
|
|
3
|
+
<p><strong>Comprehensive weather data retrieval and visualization tools</strong></p>
|
|
4
|
+
|
|
5
|
+
<!-- Badges -->
|
|
6
|
+
<p>
|
|
7
|
+
<a href="#-installation"><img src="https://img.shields.io/badge/Easy-Installation-success?style=flat-square" alt="Easy Installation"></a>
|
|
8
|
+
<a href="#-current-weather-data"><img src="https://img.shields.io/badge/Real--time-Data-blue?style=flat-square" alt="Real-time Data"></a>
|
|
9
|
+
<a href="#-ascii-art-weather"><img src="https://img.shields.io/badge/ASCII-Visualization-orange?style=flat-square" alt="ASCII Visualization"></a>
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
> [!NOTE]
|
|
14
|
+
> Webscout's Weather Toolkit provides powerful tools to retrieve and display weather information in various formats, including structured data and ASCII art visualization.
|
|
15
|
+
|
|
16
|
+
## 📋 Table of Contents
|
|
17
|
+
|
|
18
|
+
- [🚀 Installation](#-installation)
|
|
19
|
+
- [🌡️ Current Weather Data](#-current-weather-data)
|
|
20
|
+
- [🔮 Weather Forecast](#-weather-forecast)
|
|
21
|
+
- [🎨 ASCII Art Weather](#-ascii-art-weather)
|
|
22
|
+
- [📊 Data Structure](#-data-structure)
|
|
23
|
+
- [⚙️ Advanced Usage](#-advanced-usage)
|
|
24
|
+
|
|
25
|
+
## 🚀 Installation
|
|
26
|
+
|
|
27
|
+
The Weather Toolkit is included in the Webscout package. Install or update Webscout to get access:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install -U webscout
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 🌡️ Current Weather Data
|
|
34
|
+
|
|
35
|
+
Retrieve structured current weather information for any location worldwide.
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from webscout.Extra import weather
|
|
39
|
+
|
|
40
|
+
# Get weather for a specific location
|
|
41
|
+
forecast = weather.get("London")
|
|
42
|
+
|
|
43
|
+
# Access current conditions
|
|
44
|
+
print(f"Current weather: {forecast.summary}")
|
|
45
|
+
|
|
46
|
+
# Access temperature details
|
|
47
|
+
if forecast.current_condition:
|
|
48
|
+
print(f"Temperature: {forecast.current_condition.temp_c}°C / {forecast.current_condition.temp_f}°F")
|
|
49
|
+
print(f"Feels like: {forecast.current_condition.feels_like_c}°C")
|
|
50
|
+
print(f"Conditions: {forecast.current_condition.weather_desc}")
|
|
51
|
+
print(f"Wind: {forecast.current_condition.wind_speed_kmph} km/h from {forecast.current_condition.wind_direction}")
|
|
52
|
+
print(f"Humidity: {forecast.current_condition.humidity}%")
|
|
53
|
+
print(f"Visibility: {forecast.current_condition.visibility} km")
|
|
54
|
+
print(f"Pressure: {forecast.current_condition.pressure} mb")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 🔮 Weather Forecast
|
|
58
|
+
|
|
59
|
+
Access detailed forecast information for today and upcoming days.
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from webscout.Extra import weather
|
|
63
|
+
|
|
64
|
+
forecast = weather.get("Tokyo")
|
|
65
|
+
|
|
66
|
+
# Today's forecast
|
|
67
|
+
if forecast.today:
|
|
68
|
+
print(f"Today ({forecast.today.date_formatted}):")
|
|
69
|
+
print(f" Temperature range: {forecast.today.min_temp_c}°C - {forecast.today.max_temp_c}°C")
|
|
70
|
+
print(f" Sunrise: {forecast.today.sunrise}, Sunset: {forecast.today.sunset}")
|
|
71
|
+
|
|
72
|
+
# Access hourly forecasts
|
|
73
|
+
if forecast.today.hourly and len(forecast.today.hourly) > 4:
|
|
74
|
+
noon = forecast.today.hourly[4] # Noon (12:00) is usually index 4
|
|
75
|
+
print(f" Noon conditions: {noon.weather_desc}")
|
|
76
|
+
print(f" Chance of rain: {noon.chance_of_rain}%")
|
|
77
|
+
print(f" Humidity: {noon.humidity}%")
|
|
78
|
+
print(f" UV Index: {noon.uv_index}")
|
|
79
|
+
|
|
80
|
+
# Tomorrow's forecast
|
|
81
|
+
if forecast.tomorrow:
|
|
82
|
+
print(f"\nTomorrow ({forecast.tomorrow.date_formatted}):")
|
|
83
|
+
print(f" Temperature range: {forecast.tomorrow.min_temp_c}°C - {forecast.tomorrow.max_temp_c}°C")
|
|
84
|
+
print(f" Weather: {forecast.tomorrow.weather_desc}")
|
|
85
|
+
print(f" Sunrise: {forecast.tomorrow.sunrise}, Sunset: {forecast.tomorrow.sunset}")
|
|
86
|
+
|
|
87
|
+
# Extended forecast (next 3 days)
|
|
88
|
+
if forecast.days and len(forecast.days) > 2:
|
|
89
|
+
print("\nExtended Forecast:")
|
|
90
|
+
for day in forecast.days[2:5]: # Days 3-5
|
|
91
|
+
print(f" {day.date_formatted}: {day.min_temp_c}°C - {day.max_temp_c}°C, {day.weather_desc}")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 🎨 ASCII Art Weather
|
|
95
|
+
|
|
96
|
+
Retrieve weather information as visually appealing ASCII art.
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from webscout.Extra import weather_ascii
|
|
100
|
+
|
|
101
|
+
# Get ASCII art weather
|
|
102
|
+
result = weather_ascii.get("Paris")
|
|
103
|
+
|
|
104
|
+
# Display the ASCII art weather
|
|
105
|
+
print(result.content)
|
|
106
|
+
|
|
107
|
+
# Get ASCII art with temperature in Fahrenheit
|
|
108
|
+
result_f = weather_ascii.get("New York", units="imperial")
|
|
109
|
+
print(result_f.content)
|
|
110
|
+
|
|
111
|
+
# Get ASCII art with a specific number of forecast days
|
|
112
|
+
result_days = weather_ascii.get("Berlin", days=3)
|
|
113
|
+
print(result_days.content)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Example output:
|
|
117
|
+
```
|
|
118
|
+
Weather for Paris, France
|
|
119
|
+
|
|
120
|
+
\ / Clear
|
|
121
|
+
.-. +20°C
|
|
122
|
+
― ( ) ― ↗ 11 km/h
|
|
123
|
+
`-' 10 km
|
|
124
|
+
/ \ 0.0 mm
|
|
125
|
+
┌─────────────┐
|
|
126
|
+
┌───────────────────────┤ Wed 14 Apr ├───────────────────────┐
|
|
127
|
+
│ Morning └──────┬──────┘ Evening Night │
|
|
128
|
+
├──────────────────────────────┼──────────────────────────────┤
|
|
129
|
+
│ Cloudy │ Clear │
|
|
130
|
+
│ .--. +20..+22 °C │ \ / +15 °C │
|
|
131
|
+
│ .-( ). ↗ 11-13 km/h │ .-. ↗ 7-9 km/h │
|
|
132
|
+
│ (___.__)__) 10 km │ ― ( ) ― 10 km │
|
|
133
|
+
│ 0.0 mm | 0% │ `-' 0.0 mm | 0% │
|
|
134
|
+
└──────────────────────────────┴──────────────────────────────┘
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 📊 Data Structure
|
|
138
|
+
|
|
139
|
+
The Weather Toolkit returns structured data objects with the following key components:
|
|
140
|
+
|
|
141
|
+
<details>
|
|
142
|
+
<summary><strong>Forecast Object Structure</strong></summary>
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
forecast = weather.get("London")
|
|
146
|
+
|
|
147
|
+
# Main forecast object attributes
|
|
148
|
+
forecast.location # Location information (city, country, etc.)
|
|
149
|
+
forecast.summary # Brief summary of current weather
|
|
150
|
+
forecast.current_condition # Current weather conditions
|
|
151
|
+
forecast.today # Today's forecast
|
|
152
|
+
forecast.tomorrow # Tomorrow's forecast
|
|
153
|
+
forecast.days # List of daily forecasts (including today and tomorrow)
|
|
154
|
+
|
|
155
|
+
# Current condition attributes
|
|
156
|
+
current = forecast.current_condition
|
|
157
|
+
current.temp_c # Temperature in Celsius
|
|
158
|
+
current.temp_f # Temperature in Fahrenheit
|
|
159
|
+
current.feels_like_c # "Feels like" temperature in Celsius
|
|
160
|
+
current.feels_like_f # "Feels like" temperature in Fahrenheit
|
|
161
|
+
current.wind_speed_kmph # Wind speed in km/h
|
|
162
|
+
current.wind_speed_mph # Wind speed in mph
|
|
163
|
+
current.wind_direction # Wind direction (e.g., "NW")
|
|
164
|
+
current.humidity # Humidity percentage
|
|
165
|
+
current.pressure # Atmospheric pressure in millibars
|
|
166
|
+
current.visibility # Visibility in kilometers
|
|
167
|
+
current.weather_desc # Weather description (e.g., "Partly cloudy")
|
|
168
|
+
current.weather_code # Weather code for icon mapping
|
|
169
|
+
|
|
170
|
+
# Daily forecast attributes
|
|
171
|
+
day = forecast.today # or any day from forecast.days
|
|
172
|
+
day.date # Date (YYYY-MM-DD)
|
|
173
|
+
day.date_formatted # Formatted date (e.g., "Wed 14 Apr")
|
|
174
|
+
day.max_temp_c # Maximum temperature in Celsius
|
|
175
|
+
day.min_temp_c # Minimum temperature in Celsius
|
|
176
|
+
day.max_temp_f # Maximum temperature in Fahrenheit
|
|
177
|
+
day.min_temp_f # Minimum temperature in Fahrenheit
|
|
178
|
+
day.sunrise # Sunrise time
|
|
179
|
+
day.sunset # Sunset time
|
|
180
|
+
day.weather_desc # Weather description
|
|
181
|
+
day.weather_code # Weather code
|
|
182
|
+
day.hourly # List of hourly forecasts for this day
|
|
183
|
+
```
|
|
184
|
+
</details>
|
|
185
|
+
|
|
186
|
+
<details>
|
|
187
|
+
<summary><strong>ASCII Weather Object Structure</strong></summary>
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
result = weather_ascii.get("Paris")
|
|
191
|
+
|
|
192
|
+
# ASCII result attributes
|
|
193
|
+
result.content # The full ASCII art weather display
|
|
194
|
+
result.location # Location information
|
|
195
|
+
result.temperature # Current temperature
|
|
196
|
+
result.conditions # Current weather conditions
|
|
197
|
+
result.forecast_days # Number of forecast days included
|
|
198
|
+
```
|
|
199
|
+
</details>
|
|
200
|
+
|
|
201
|
+
## ⚙️ Advanced Usage
|
|
202
|
+
|
|
203
|
+
<details>
|
|
204
|
+
<summary><strong>Custom Location Formats</strong></summary>
|
|
205
|
+
|
|
206
|
+
The Weather Toolkit supports various location formats:
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
# City name
|
|
210
|
+
weather.get("London")
|
|
211
|
+
|
|
212
|
+
# City and country
|
|
213
|
+
weather.get("Paris, France")
|
|
214
|
+
|
|
215
|
+
# ZIP/Postal code (US)
|
|
216
|
+
weather.get("10001") # New York, NY
|
|
217
|
+
|
|
218
|
+
# Latitude and Longitude
|
|
219
|
+
weather.get("40.7128,-74.0060") # New York coordinates
|
|
220
|
+
```
|
|
221
|
+
</details>
|
|
222
|
+
|
|
223
|
+
<details>
|
|
224
|
+
<summary><strong>Temperature Units</strong></summary>
|
|
225
|
+
|
|
226
|
+
Control temperature units in ASCII weather display:
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
# Default (metric - Celsius)
|
|
230
|
+
weather_ascii.get("Tokyo")
|
|
231
|
+
|
|
232
|
+
# Imperial (Fahrenheit)
|
|
233
|
+
weather_ascii.get("New York", units="imperial")
|
|
234
|
+
|
|
235
|
+
# Metric (Celsius)
|
|
236
|
+
weather_ascii.get("Berlin", units="metric")
|
|
237
|
+
```
|
|
238
|
+
</details>
|
|
239
|
+
|
|
240
|
+
<details>
|
|
241
|
+
<summary><strong>Forecast Days</strong></summary>
|
|
242
|
+
|
|
243
|
+
Control the number of forecast days in ASCII weather display:
|
|
244
|
+
|
|
245
|
+
```python
|
|
246
|
+
# Default (1 day)
|
|
247
|
+
weather_ascii.get("Sydney")
|
|
248
|
+
|
|
249
|
+
# 3-day forecast
|
|
250
|
+
weather_ascii.get("Rio de Janeiro", days=3)
|
|
251
|
+
|
|
252
|
+
# 5-day forecast (maximum)
|
|
253
|
+
weather_ascii.get("Moscow", days=5)
|
|
254
|
+
```
|
|
255
|
+
</details>
|
|
256
|
+
|
|
257
|
+
<details>
|
|
258
|
+
<summary><strong>Error Handling</strong></summary>
|
|
259
|
+
|
|
260
|
+
Implement proper error handling for robust applications:
|
|
261
|
+
|
|
262
|
+
```python
|
|
263
|
+
from webscout.Extra import weather
|
|
264
|
+
from webscout.exceptions import APIError
|
|
265
|
+
|
|
266
|
+
try:
|
|
267
|
+
forecast = weather.get("London")
|
|
268
|
+
print(f"Current temperature: {forecast.current_condition.temp_c}°C")
|
|
269
|
+
except APIError as e:
|
|
270
|
+
print(f"API Error: {e}")
|
|
271
|
+
except Exception as e:
|
|
272
|
+
print(f"An error occurred: {e}")
|
|
273
|
+
```
|
|
274
|
+
</details>
|
|
275
|
+
|
|
276
|
+
<div align="center">
|
|
277
|
+
<p>
|
|
278
|
+
<a href="https://github.com/OEvortex/Webscout"><img alt="GitHub Repository" src="https://img.shields.io/badge/GitHub-Repository-181717?style=for-the-badge&logo=github&logoColor=white"></a>
|
|
279
|
+
<a href="https://t.me/PyscoutAI"><img alt="Telegram Group" src="https://img.shields.io/badge/Telegram%20Group-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
|
|
280
|
+
</p>
|
|
281
|
+
</div>
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# 📝 LitLogger - The Most Fire Logger You'll Ever Use!
|
|
2
|
+
|
|
3
|
+
Yo fam! Meet LitLogger - your new logging bestie that's built different! 🔥 With smart level detection, fire color schemes, and emoji support, your logs never looked this good!
|
|
4
|
+
|
|
5
|
+
## 🚀 Quick Start
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from webscout import LitLogger, LogFormat, ColorScheme
|
|
9
|
+
|
|
10
|
+
# Create your logger with style
|
|
11
|
+
logger = LitLogger(
|
|
12
|
+
name="MyApp",
|
|
13
|
+
format=LogFormat.MODERN_EMOJI,
|
|
14
|
+
color_scheme=ColorScheme.CYBERPUNK
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# Start logging with swag
|
|
18
|
+
logger.info("App started! 🚀")
|
|
19
|
+
logger.success("Mission accomplished! 💯")
|
|
20
|
+
logger.warning("CPU getting spicy! 🌶️")
|
|
21
|
+
logger.error("Houston, we got a problem! 🔧")
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 💫 Features That Hit Different
|
|
25
|
+
|
|
26
|
+
### 🎨 Fire Color Schemes
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
# Cyberpunk vibes
|
|
30
|
+
logger = LitLogger(color_scheme=ColorScheme.CYBERPUNK)
|
|
31
|
+
|
|
32
|
+
# Ocean feels
|
|
33
|
+
logger = LitLogger(color_scheme=ColorScheme.OCEAN)
|
|
34
|
+
|
|
35
|
+
# Matrix mode
|
|
36
|
+
logger = LitLogger(color_scheme=ColorScheme.MATRIX)
|
|
37
|
+
|
|
38
|
+
# Aurora lights
|
|
39
|
+
logger = LitLogger(color_scheme=ColorScheme.AURORA)
|
|
40
|
+
|
|
41
|
+
# Sunset mood
|
|
42
|
+
logger = LitLogger(color_scheme=ColorScheme.SUNSET)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 📝 Lit Log Formats
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
# Modern with emojis
|
|
49
|
+
logger = LitLogger(format=LogFormat.MODERN_EMOJI)
|
|
50
|
+
# Output: 🚀 [2024-01-20 15:30:45] INFO Server started!
|
|
51
|
+
|
|
52
|
+
# Clean and minimal
|
|
53
|
+
logger = LitLogger(format=LogFormat.MODERN_CLEAN)
|
|
54
|
+
# Output: 2024-01-20 15:30:45 INFO Server started
|
|
55
|
+
|
|
56
|
+
# Boxed style
|
|
57
|
+
logger = LitLogger(format=LogFormat.BOXED)
|
|
58
|
+
# Output: ╭─────────────────────╮
|
|
59
|
+
# │ [2024-01-20 15:30:45]
|
|
60
|
+
# │ INFO - MyApp
|
|
61
|
+
# │ Server started!
|
|
62
|
+
# ╰─────────────────────╯
|
|
63
|
+
|
|
64
|
+
# Japanese style
|
|
65
|
+
logger = LitLogger(format=LogFormat.MODERN_BRACKET)
|
|
66
|
+
# Output: 【2024-01-20 15:30:45】「INFO」Server started
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 🧠 Smart Level Detection
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
# Auto-detects appropriate log level
|
|
73
|
+
logger.auto("Starting server...") # INFO
|
|
74
|
+
logger.auto("CPU usage at 95%") # WARNING
|
|
75
|
+
logger.auto("404: Not Found") # ERROR
|
|
76
|
+
logger.auto("x = calculate(y)") # DEBUG
|
|
77
|
+
|
|
78
|
+
# With context
|
|
79
|
+
logger.auto("Memory usage: 90%", memory=90) # WARNING
|
|
80
|
+
logger.auto("Response time: 1500ms", latency=1500) # WARNING
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 🎯 Log Levels
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
# All the levels you need
|
|
87
|
+
logger.trace("Entering function...")
|
|
88
|
+
logger.debug("x = 42")
|
|
89
|
+
logger.info("Server started")
|
|
90
|
+
logger.success("Task completed")
|
|
91
|
+
logger.warning("Running low on memory")
|
|
92
|
+
logger.error("Failed to connect")
|
|
93
|
+
logger.critical("System crash!")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 🌟 Real-World Examples
|
|
97
|
+
|
|
98
|
+
### API Server Logging
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
logger = LitLogger(name="APIServer", format=LogFormat.MODERN_EMOJI)
|
|
102
|
+
|
|
103
|
+
def handle_request():
|
|
104
|
+
logger.info("Received new request 📥")
|
|
105
|
+
try:
|
|
106
|
+
# Process request
|
|
107
|
+
logger.success("Request processed successfully ✨")
|
|
108
|
+
except Exception as e:
|
|
109
|
+
logger.error(f"Request failed: {e} 💀")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Performance Monitoring
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
logger = LitLogger(name="Monitor", color_scheme=ColorScheme.MATRIX)
|
|
116
|
+
|
|
117
|
+
def monitor_system():
|
|
118
|
+
metrics = get_system_metrics()
|
|
119
|
+
logger.auto(
|
|
120
|
+
f"CPU: {metrics['cpu']}%, Memory: {metrics['memory']}%",
|
|
121
|
+
cpu=metrics['cpu'],
|
|
122
|
+
memory=metrics['memory']
|
|
123
|
+
)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Development Debugging
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
logger = LitLogger(name="Debug", format=LogFormat.DETAILED)
|
|
130
|
+
|
|
131
|
+
def complex_calculation(x, y):
|
|
132
|
+
logger.debug(f"Input: x={x}, y={y}")
|
|
133
|
+
result = x * y
|
|
134
|
+
logger.debug(f"Result: {result}")
|
|
135
|
+
return result
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## 🎮 Pro Tips
|
|
139
|
+
|
|
140
|
+
1. **Custom Color Schemes**: Create your own vibe
|
|
141
|
+
```python
|
|
142
|
+
my_scheme = {
|
|
143
|
+
"trace": (128, 128, 255), # Your colors
|
|
144
|
+
"debug": (255, 0, 255),
|
|
145
|
+
"info": (0, 255, 255)
|
|
146
|
+
}
|
|
147
|
+
logger = LitLogger(color_scheme=my_scheme)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
2. **Log to File**: Keep records with style
|
|
151
|
+
```python
|
|
152
|
+
logger = LitLogger(
|
|
153
|
+
name="MyApp",
|
|
154
|
+
log_path="logs/app.log",
|
|
155
|
+
console_output=True # Both file and console
|
|
156
|
+
)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
3. **Smart Context**: Let the logger decide
|
|
160
|
+
```python
|
|
161
|
+
# Automatically chooses log level based on content
|
|
162
|
+
logger.auto("Database connection failed") # ERROR
|
|
163
|
+
logger.auto("Cache hit ratio: 95%") # INFO
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## 🔥 Why LitLogger?
|
|
167
|
+
|
|
168
|
+
- 🎨 Beautiful, colorful output
|
|
169
|
+
- 🧠 Smart level detection
|
|
170
|
+
- 📱 Multiple output formats
|
|
171
|
+
- 🌈 Customizable color schemes
|
|
172
|
+
- 💪 Easy to use, hard to mess up
|
|
173
|
+
- ⚡ Fast and lightweight
|
|
174
|
+
|
|
175
|
+
Made with 💖 by the HelpingAI team
|
|
@@ -84,30 +84,11 @@ class DeepFind(AISearch):
|
|
|
84
84
|
>>> ai = DeepFind(proxies={'http': 'http://proxy.com:8080'}) # With proxy
|
|
85
85
|
"""
|
|
86
86
|
self.session = requests.Session()
|
|
87
|
-
self.api_endpoint = "https://www.deepfind.co/?q={query}"
|
|
88
87
|
self.stream_chunk_size = 1024
|
|
89
88
|
self.timeout = timeout
|
|
90
89
|
self.last_response = {}
|
|
91
|
-
self.headers = {
|
|
92
|
-
"Accept": "text/x-component",
|
|
93
|
-
"Accept-Encoding": "gzip, deflate, br, zstd",
|
|
94
|
-
"Accept-Language": "en-US,en;q=0.9,en-IN;q=0.8",
|
|
95
|
-
"Content-Type": "text/plain;charset=UTF-8",
|
|
96
|
-
"DNT": "1",
|
|
97
|
-
"Next-Action": "f354668f23f516a46ad0abe4dedb84b19068bb54",
|
|
98
|
-
"Next-Router-State-Tree": '%5B%22%22%2C%7B%22children%22%3A%5B%22__PAGE__%3F%7B%5C%22q%5C%22%3A%5C%22hi%5C%22%7D%22%2C%7B%7D%2C%22%2F%3Fq%3Dhi%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%2Ctrue%5D',
|
|
99
|
-
"Origin": "https://www.deepfind.co",
|
|
100
|
-
"Referer": "https://www.deepfind.co/?q=hi",
|
|
101
|
-
"Sec-Ch-Ua": '"Not A(Brand";v="8", "Chromium";v="132", "Microsoft Edge";v="132"',
|
|
102
|
-
"Sec-Ch-Ua-Mobile": "?0",
|
|
103
|
-
"Sec-Ch-Ua-Platform": '"Windows"',
|
|
104
|
-
"Sec-Fetch-Dest": "empty",
|
|
105
|
-
"Sec-Fetch-Mode": "cors",
|
|
106
|
-
"Sec-Fetch-Site": "same-origin",
|
|
107
|
-
"User-Agent": LitAgent().random(),
|
|
108
|
-
}
|
|
109
|
-
self.session.headers.update(self.headers)
|
|
110
90
|
self.proxies = proxies
|
|
91
|
+
# Headers will be set per request, as conversationId is dynamic
|
|
111
92
|
|
|
112
93
|
def search(
|
|
113
94
|
self,
|
|
@@ -160,25 +141,61 @@ class DeepFind(AISearch):
|
|
|
160
141
|
... except exceptions.APIConnectionError as e:
|
|
161
142
|
... print(f"API error: {e}")
|
|
162
143
|
"""
|
|
163
|
-
|
|
144
|
+
conversation_id = uuid4().hex
|
|
145
|
+
message_id = uuid4().hex
|
|
146
|
+
url = f"https://www.deepfind.co/s/{conversation_id}"
|
|
164
147
|
payload = [
|
|
165
|
-
|
|
166
|
-
|
|
148
|
+
{
|
|
149
|
+
"id": conversation_id,
|
|
150
|
+
"messages": [
|
|
151
|
+
{
|
|
152
|
+
"role": "user",
|
|
153
|
+
"conversationId": conversation_id,
|
|
154
|
+
"messageId": message_id,
|
|
155
|
+
"content": prompt,
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
conversation_id,
|
|
160
|
+
message_id,
|
|
167
161
|
]
|
|
162
|
+
# Update headers for this conversation
|
|
163
|
+
headers = {
|
|
164
|
+
"Accept": "text/x-component",
|
|
165
|
+
"Accept-Encoding": "gzip, deflate, br, zstd",
|
|
166
|
+
"Accept-Language": "en-US,en;q=0.9,en-IN;q=0.8",
|
|
167
|
+
"Content-Type": "text/plain;charset=UTF-8",
|
|
168
|
+
"DNT": "1",
|
|
169
|
+
"Next-Action": "f354668f23f516a46ad0abe4dedb84b19068bb54",
|
|
170
|
+
"Next-Router-State-Tree": f'%5B%22%22%2C%7B%22children%22%3A%5B%22s%22%2C%7B%22children%22%3A%5B%5B%22conversationId%22%2C%22{conversation_id}%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2Fs%2F{conversation_id}%22%2C%22refresh%22%5D%7D%5D%7D%5D%7D%2Cnull%2Cnull%2Ctrue%5D',
|
|
171
|
+
"Origin": "https://www.deepfind.co",
|
|
172
|
+
"Referer": f"https://www.deepfind.co/s/{conversation_id}",
|
|
173
|
+
"Sec-Ch-Ua": '"Not A(Brand";v="8", "Chromium";v="132", "Microsoft Edge";v="132"',
|
|
174
|
+
"Sec-Ch-Ua-Mobile": "?0",
|
|
175
|
+
"Sec-Ch-Ua-Platform": '"Windows"',
|
|
176
|
+
"Sec-Fetch-Dest": "empty",
|
|
177
|
+
"Sec-Fetch-Mode": "cors",
|
|
178
|
+
"Sec-Fetch-Site": "same-origin",
|
|
179
|
+
"User-Agent": LitAgent().random(),
|
|
180
|
+
}
|
|
181
|
+
self.session.headers.clear()
|
|
182
|
+
self.session.headers.update(headers)
|
|
168
183
|
|
|
169
184
|
def for_stream():
|
|
170
185
|
try:
|
|
171
186
|
with self.session.post(
|
|
172
187
|
url,
|
|
173
|
-
headers=
|
|
188
|
+
headers=headers,
|
|
174
189
|
json=payload,
|
|
175
190
|
stream=True,
|
|
176
191
|
timeout=self.timeout,
|
|
192
|
+
proxies=self.proxies,
|
|
177
193
|
) as response:
|
|
178
194
|
response.raise_for_status()
|
|
179
195
|
streaming_text = ""
|
|
180
196
|
for line in response.iter_lines(decode_unicode=True):
|
|
181
197
|
if line:
|
|
198
|
+
# Try to extract content from the new streaming format
|
|
182
199
|
content_matches = re.findall(r'"content":"([^"\\]*(?:\\.[^"\\]*)*)"', line)
|
|
183
200
|
if content_matches:
|
|
184
201
|
for content in content_matches:
|
|
@@ -191,18 +208,6 @@ class DeepFind(AISearch):
|
|
|
191
208
|
yield {"text": delta}
|
|
192
209
|
else:
|
|
193
210
|
yield Response(delta)
|
|
194
|
-
description_matches = re.findall(r'"description":"([^"\\]*(?:\\.[^"\\]*)*)"', line)
|
|
195
|
-
if description_matches:
|
|
196
|
-
for description in description_matches:
|
|
197
|
-
if description and len(description) > len(streaming_text):
|
|
198
|
-
delta = description[len(streaming_text):]
|
|
199
|
-
streaming_text = description
|
|
200
|
-
delta = delta.replace('\\"', '"').replace('\\n', '\n')
|
|
201
|
-
delta = re.sub(r'\[REF\]\(https?://[^\s]*\)', '', delta)
|
|
202
|
-
if raw:
|
|
203
|
-
yield {"text": f"{delta}\n"}
|
|
204
|
-
else:
|
|
205
|
-
yield Response(f"{delta}\n")
|
|
206
211
|
self.last_response = Response(streaming_text)
|
|
207
212
|
except requests.exceptions.RequestException as e:
|
|
208
213
|
raise exceptions.APIConnectionError(f"Request failed: {e}")
|
|
@@ -217,7 +222,6 @@ class DeepFind(AISearch):
|
|
|
217
222
|
if not raw:
|
|
218
223
|
self.last_response = Response(full_response)
|
|
219
224
|
return self.last_response
|
|
220
|
-
|
|
221
225
|
return for_stream() if stream else for_non_stream()
|
|
222
226
|
|
|
223
227
|
@staticmethod
|