dexscreen 0.0.4__py3-none-any.whl → 0.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dexscreen/core/http.py +10 -12
- {dexscreen-0.0.4.dist-info → dexscreen-0.0.5.dist-info}/METADATA +1 -1
- {dexscreen-0.0.4.dist-info → dexscreen-0.0.5.dist-info}/RECORD +5 -5
- {dexscreen-0.0.4.dist-info → dexscreen-0.0.5.dist-info}/WHEEL +0 -0
- {dexscreen-0.0.4.dist-info → dexscreen-0.0.5.dist-info}/licenses/LICENSE +0 -0
dexscreen/core/http.py
CHANGED
@@ -160,23 +160,23 @@ class HttpClientCffi:
|
|
160
160
|
) -> Union[list, dict, None]:
|
161
161
|
"""Parse JSON response with proper error handling and logging"""
|
162
162
|
content_type = response.headers.get("content-type", "")
|
163
|
-
|
163
|
+
|
164
164
|
if "application/json" not in content_type:
|
165
165
|
# Non-JSON response
|
166
166
|
content_preview = (
|
167
|
-
response.content[:200].decode("utf-8", errors="replace")
|
167
|
+
response.content[:200].decode("utf-8", errors="replace")
|
168
168
|
if response.content else ""
|
169
169
|
)
|
170
|
-
|
170
|
+
|
171
171
|
parse_context = context.copy()
|
172
172
|
parse_context.update({
|
173
173
|
"expected_json": True,
|
174
174
|
"received_content_type": content_type,
|
175
175
|
"content_preview": content_preview,
|
176
176
|
})
|
177
|
-
|
177
|
+
|
178
178
|
self.logger.warning("Received non-JSON response when JSON expected", context=parse_context)
|
179
|
-
|
179
|
+
|
180
180
|
raise HttpResponseParsingError(
|
181
181
|
method,
|
182
182
|
url,
|
@@ -184,28 +184,28 @@ class HttpClientCffi:
|
|
184
184
|
content_preview,
|
185
185
|
original_error=Exception(f"Expected JSON response but got {content_type}")
|
186
186
|
)
|
187
|
-
|
187
|
+
|
188
188
|
try:
|
189
189
|
return orjson.loads(response.content)
|
190
190
|
except Exception as e:
|
191
191
|
content_preview = (
|
192
|
-
response.content[:200].decode("utf-8", errors="replace")
|
192
|
+
response.content[:200].decode("utf-8", errors="replace")
|
193
193
|
if response.content else ""
|
194
194
|
)
|
195
|
-
|
195
|
+
|
196
196
|
parse_context = context.copy()
|
197
197
|
parse_context.update({
|
198
198
|
"parse_error": str(e),
|
199
199
|
"content_preview": content_preview,
|
200
200
|
})
|
201
|
-
|
201
|
+
|
202
202
|
self.logger.error(
|
203
203
|
"Failed to parse JSON response: %s",
|
204
204
|
str(e),
|
205
205
|
context=parse_context,
|
206
206
|
exc_info=True
|
207
207
|
)
|
208
|
-
|
208
|
+
|
209
209
|
raise HttpResponseParsingError(
|
210
210
|
method, url, content_type, content_preview, original_error=e
|
211
211
|
) from e
|
@@ -228,12 +228,10 @@ class HttpClientCffi:
|
|
228
228
|
|
229
229
|
# Warm up connection
|
230
230
|
warmup_start = time.time()
|
231
|
-
warmup_success = False
|
232
231
|
try:
|
233
232
|
warmup_url = self._create_absolute_url(self.warmup_url)
|
234
233
|
response = await self._primary_session.get(warmup_url)
|
235
234
|
if response.status_code == 200:
|
236
|
-
warmup_success = True
|
237
235
|
warmup_duration = time.time() - warmup_start
|
238
236
|
|
239
237
|
session_context.update(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dexscreen
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.5
|
4
4
|
Summary: Python wrapper for Dexscreener API with stable HTTP support
|
5
5
|
Project-URL: Repository, https://github.com/solanab/dexscreen
|
6
6
|
Project-URL: Documentation, https://github.com/solanab/dexscreen#readme
|
@@ -4,7 +4,7 @@ dexscreen/api/client.py,sha256=ic_EcFpnr4VfL3chHIpaovvBhf2qYRlLwTT21ssFkr8,37847
|
|
4
4
|
dexscreen/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
dexscreen/core/__init__.py,sha256=_QvgIu4e9RG06TrCTC-BIJMJ5duEFwp1LLTZ7sG4YuM,490
|
6
6
|
dexscreen/core/exceptions.py,sha256=IKL-_yWJ3fjmdj09QxOLHTF0zHeinkL0IY7bL51VpmQ,34339
|
7
|
-
dexscreen/core/http.py,sha256=
|
7
|
+
dexscreen/core/http.py,sha256=BBj7Z4ULK1rheb27eokh-bTCAopctdLuLq1_UGUHtWQ,48913
|
8
8
|
dexscreen/core/models.py,sha256=7-EN63yyQK92T1ZRhfHwwXJ8Cg1VbO3CY-wdlpljIu4,2573
|
9
9
|
dexscreen/core/validators.py,sha256=BFoey2XangE_i7bxLtuBlRVL-PbUh4ZIrGPq0seRvVI,14536
|
10
10
|
dexscreen/stream/__init__.py,sha256=vqoiFQ4LwLjaIEWl7p60StTfG1bSJhyEapjWILVP168,100
|
@@ -16,7 +16,7 @@ dexscreen/utils/logging_config.py,sha256=M5CJNx8rqZsYTAQF-yT1wVQgj7TvEmR87wJkDCm
|
|
16
16
|
dexscreen/utils/middleware.py,sha256=7oq628-W9bgoIoAx4W48V-dl3G0WVPThVgwhCCN8q58,12758
|
17
17
|
dexscreen/utils/ratelimit.py,sha256=u6VqMVV5mV5XLJpQSPvDFo618Y29rPt76PN0aArnIDo,10203
|
18
18
|
dexscreen/utils/retry.py,sha256=-nwhU3GwJULLxCoD4er_wh1EWxh96tf4uDzEdFsrEmQ,12536
|
19
|
-
dexscreen-0.0.
|
20
|
-
dexscreen-0.0.
|
21
|
-
dexscreen-0.0.
|
22
|
-
dexscreen-0.0.
|
19
|
+
dexscreen-0.0.5.dist-info/METADATA,sha256=ds8A955tZ5EKhs92ZzQYT_Vb8pE-uxIyfy7BxtWpqeA,9345
|
20
|
+
dexscreen-0.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
21
|
+
dexscreen-0.0.5.dist-info/licenses/LICENSE,sha256=YLNduNj40Iu4upUYI6XEXrgBlv0hxMNf6uEVAJITYN0,1064
|
22
|
+
dexscreen-0.0.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|