dexscreen 0.0.2__tar.gz → 0.0.5__tar.gz
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-0.0.2 → dexscreen-0.0.5}/.github/workflows/release.yml +6 -4
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.gitignore +5 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.yamllint +1 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/PKG-INFO +52 -1
- {dexscreen-0.0.2 → dexscreen-0.0.5}/README.md +51 -0
- dexscreen-0.0.5/dexscreen/__init__.py +118 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/api/client.py +275 -42
- dexscreen-0.0.5/dexscreen/core/exceptions.py +1067 -0
- dexscreen-0.0.5/dexscreen/core/http.py +1202 -0
- dexscreen-0.0.5/dexscreen/core/validators.py +542 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/stream/polling.py +288 -78
- dexscreen-0.0.5/dexscreen/utils/__init__.py +57 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/utils/filters.py +182 -12
- dexscreen-0.0.5/dexscreen/utils/logging_config.py +421 -0
- dexscreen-0.0.5/dexscreen/utils/middleware.py +363 -0
- dexscreen-0.0.5/dexscreen/utils/ratelimit.py +269 -0
- dexscreen-0.0.5/dexscreen/utils/retry.py +357 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/examples/01_async_basic_apis.py +4 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/examples/03_token_address_polling.py +4 -1
- dexscreen-0.0.5/examples/05_exception_handling.py +210 -0
- dexscreen-0.0.5/examples/06_timeout_configuration.py +254 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/justfile +1 -1
- {dexscreen-0.0.2 → dexscreen-0.0.5}/package.json +0 -1
- {dexscreen-0.0.2 → dexscreen-0.0.5}/pyproject.toml +3 -3
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/conftest.py +48 -27
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/api/test_batch_limits.py +69 -55
- dexscreen-0.0.5/tests/unit/api/test_batch_limits_integration.py +293 -0
- dexscreen-0.0.5/tests/unit/api/test_client.py +703 -0
- dexscreen-0.0.5/tests/unit/api/test_client_comprehensive.py +946 -0
- dexscreen-0.0.5/tests/unit/api/test_client_error_handling.py +795 -0
- dexscreen-0.0.5/tests/unit/api/test_client_subscriptions.py +858 -0
- dexscreen-0.0.5/tests/unit/api/test_timeout_functionality.py +376 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/core/test_dynamic_config.py +75 -46
- dexscreen-0.0.5/tests/unit/core/test_http.py +558 -0
- dexscreen-0.0.5/tests/unit/utils/test_retry.py +423 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/uv.lock +2 -2
- dexscreen-0.0.2/dexscreen/__init__.py +0 -31
- dexscreen-0.0.2/dexscreen/core/http.py +0 -460
- dexscreen-0.0.2/dexscreen/utils/__init__.py +0 -4
- dexscreen-0.0.2/dexscreen/utils/ratelimit.py +0 -65
- dexscreen-0.0.2/tests/unit/api/test_batch_limits_integration.py +0 -112
- dexscreen-0.0.2/tests/unit/api/test_client.py +0 -251
- dexscreen-0.0.2/tests/unit/core/test_http.py +0 -206
- dexscreen-0.0.2/tests/unit/core/test_models_simple.py +0 -74
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.gitattributes +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.github/workflows/ci.yml +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.github/workflows/docs.yml +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.nvmrc +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.pre-commit-config.yaml +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.prettierignore +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/.prettierrc.json +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/LICENSE +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/api/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/config/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/core/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/core/models.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/stream/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/dexscreen/utils/browser_selector.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/README.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/data-models.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/data-models.zh.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/filtering.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/filtering.zh.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/query-api.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/query-api.zh.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/streaming-api.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/api/streaming-api.zh.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/examples.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/examples.zh.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/getting-started.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/getting-started.zh.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/index.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/docs/index.zh.md +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/examples/02_dynamic_config_update.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/examples/04_dynamic_subscription.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/mkdocs.yml +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/pnpm-lock.yaml +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/integration/test_api_response_format.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/integration/test_examples.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/integration/test_pool_endpoint.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/integration/test_token_endpoints.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/api/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/core/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/core/test_models.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/stream/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/stream/test_batch_polling.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/stream/test_polling.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/utils/__init__.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/utils/test_filters.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/unit/utils/test_ratelimit.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/upstream/test_official_api.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/upstream/test_official_api_multi.py +0 -0
- {dexscreen-0.0.2 → dexscreen-0.0.5}/tests/upstream/test_official_api_rate.py +0 -0
@@ -3,7 +3,7 @@ name: Release
|
|
3
3
|
on:
|
4
4
|
push:
|
5
5
|
tags:
|
6
|
-
-
|
6
|
+
- "v*"
|
7
7
|
|
8
8
|
jobs:
|
9
9
|
build_and_publish:
|
@@ -31,6 +31,8 @@ jobs:
|
|
31
31
|
path: dist/
|
32
32
|
|
33
33
|
- name: Publish to PyPI
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
env:
|
35
|
+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
|
36
|
+
run: |
|
37
|
+
uv build
|
38
|
+
uv publish
|
@@ -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
|
@@ -68,8 +68,12 @@ pip install dexscreen
|
|
68
68
|
```python
|
69
69
|
from dexscreen import DexscreenerClient
|
70
70
|
|
71
|
+
# Default client with 10-second timeout
|
71
72
|
client = DexscreenerClient()
|
72
73
|
|
74
|
+
# Custom timeout client
|
75
|
+
client = DexscreenerClient(client_kwargs={"timeout": 30})
|
76
|
+
|
73
77
|
# Get a specific pair by token address
|
74
78
|
pairs = client.get_pairs_by_token_address("solana", "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN")
|
75
79
|
if pairs:
|
@@ -259,6 +263,47 @@ The SDK automatically handles rate limiting:
|
|
259
263
|
- 60 requests/minute for token profile endpoints
|
260
264
|
- 300 requests/minute for pair data endpoints
|
261
265
|
|
266
|
+
## Timeout Configuration
|
267
|
+
|
268
|
+
The SDK provides flexible timeout configuration for different use cases:
|
269
|
+
|
270
|
+
### Default Timeout
|
271
|
+
```python
|
272
|
+
# Default timeout is 10 seconds
|
273
|
+
client = DexscreenerClient()
|
274
|
+
```
|
275
|
+
|
276
|
+
### Custom Timeout
|
277
|
+
```python
|
278
|
+
# Set custom timeout during initialization
|
279
|
+
client = DexscreenerClient(client_kwargs={"timeout": 30})
|
280
|
+
|
281
|
+
# Different timeouts for different scenarios
|
282
|
+
fast_client = DexscreenerClient(client_kwargs={"timeout": 5}) # Quick responses
|
283
|
+
stable_client = DexscreenerClient(client_kwargs={"timeout": 60}) # Stable connections
|
284
|
+
```
|
285
|
+
|
286
|
+
### Runtime Timeout Updates
|
287
|
+
```python
|
288
|
+
# Update timeout at runtime
|
289
|
+
await client._client_300rpm.update_config({"timeout": 15})
|
290
|
+
|
291
|
+
# Multiple config updates including timeout
|
292
|
+
await client._client_300rpm.update_config({
|
293
|
+
"timeout": 25,
|
294
|
+
"impersonate": "chrome136"
|
295
|
+
})
|
296
|
+
```
|
297
|
+
|
298
|
+
### Recommended Timeout Values
|
299
|
+
|
300
|
+
| Use Case | Timeout (seconds) | Description |
|
301
|
+
|----------|------------------|-------------|
|
302
|
+
| Quick Trading | 5-10 | Fast response for time-sensitive operations |
|
303
|
+
| General Use | 10-15 | Default balanced setting |
|
304
|
+
| Stable Monitoring | 20-30 | Reliable for long-running subscriptions |
|
305
|
+
| Poor Networks | 30-60 | Handle unstable connections |
|
306
|
+
|
262
307
|
## Browser Impersonation
|
263
308
|
|
264
309
|
The SDK uses curl_cffi for browser impersonation to bypass anti-bot protection:
|
@@ -267,6 +312,12 @@ The SDK uses curl_cffi for browser impersonation to bypass anti-bot protection:
|
|
267
312
|
# Use different browser versions
|
268
313
|
client = DexscreenerClient(impersonate="chrome134")
|
269
314
|
client = DexscreenerClient(impersonate="safari180")
|
315
|
+
|
316
|
+
# Combine browser impersonation with custom timeout
|
317
|
+
client = DexscreenerClient(
|
318
|
+
impersonate="chrome136",
|
319
|
+
client_kwargs={"timeout": 20}
|
320
|
+
)
|
270
321
|
```
|
271
322
|
|
272
323
|
## Contributing
|
@@ -40,8 +40,12 @@ pip install dexscreen
|
|
40
40
|
```python
|
41
41
|
from dexscreen import DexscreenerClient
|
42
42
|
|
43
|
+
# Default client with 10-second timeout
|
43
44
|
client = DexscreenerClient()
|
44
45
|
|
46
|
+
# Custom timeout client
|
47
|
+
client = DexscreenerClient(client_kwargs={"timeout": 30})
|
48
|
+
|
45
49
|
# Get a specific pair by token address
|
46
50
|
pairs = client.get_pairs_by_token_address("solana", "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN")
|
47
51
|
if pairs:
|
@@ -231,6 +235,47 @@ The SDK automatically handles rate limiting:
|
|
231
235
|
- 60 requests/minute for token profile endpoints
|
232
236
|
- 300 requests/minute for pair data endpoints
|
233
237
|
|
238
|
+
## Timeout Configuration
|
239
|
+
|
240
|
+
The SDK provides flexible timeout configuration for different use cases:
|
241
|
+
|
242
|
+
### Default Timeout
|
243
|
+
```python
|
244
|
+
# Default timeout is 10 seconds
|
245
|
+
client = DexscreenerClient()
|
246
|
+
```
|
247
|
+
|
248
|
+
### Custom Timeout
|
249
|
+
```python
|
250
|
+
# Set custom timeout during initialization
|
251
|
+
client = DexscreenerClient(client_kwargs={"timeout": 30})
|
252
|
+
|
253
|
+
# Different timeouts for different scenarios
|
254
|
+
fast_client = DexscreenerClient(client_kwargs={"timeout": 5}) # Quick responses
|
255
|
+
stable_client = DexscreenerClient(client_kwargs={"timeout": 60}) # Stable connections
|
256
|
+
```
|
257
|
+
|
258
|
+
### Runtime Timeout Updates
|
259
|
+
```python
|
260
|
+
# Update timeout at runtime
|
261
|
+
await client._client_300rpm.update_config({"timeout": 15})
|
262
|
+
|
263
|
+
# Multiple config updates including timeout
|
264
|
+
await client._client_300rpm.update_config({
|
265
|
+
"timeout": 25,
|
266
|
+
"impersonate": "chrome136"
|
267
|
+
})
|
268
|
+
```
|
269
|
+
|
270
|
+
### Recommended Timeout Values
|
271
|
+
|
272
|
+
| Use Case | Timeout (seconds) | Description |
|
273
|
+
|----------|------------------|-------------|
|
274
|
+
| Quick Trading | 5-10 | Fast response for time-sensitive operations |
|
275
|
+
| General Use | 10-15 | Default balanced setting |
|
276
|
+
| Stable Monitoring | 20-30 | Reliable for long-running subscriptions |
|
277
|
+
| Poor Networks | 30-60 | Handle unstable connections |
|
278
|
+
|
234
279
|
## Browser Impersonation
|
235
280
|
|
236
281
|
The SDK uses curl_cffi for browser impersonation to bypass anti-bot protection:
|
@@ -239,6 +284,12 @@ The SDK uses curl_cffi for browser impersonation to bypass anti-bot protection:
|
|
239
284
|
# Use different browser versions
|
240
285
|
client = DexscreenerClient(impersonate="chrome134")
|
241
286
|
client = DexscreenerClient(impersonate="safari180")
|
287
|
+
|
288
|
+
# Combine browser impersonation with custom timeout
|
289
|
+
client = DexscreenerClient(
|
290
|
+
impersonate="chrome136",
|
291
|
+
client_kwargs={"timeout": 20}
|
292
|
+
)
|
242
293
|
```
|
243
294
|
|
244
295
|
## Contributing
|
@@ -0,0 +1,118 @@
|
|
1
|
+
"""
|
2
|
+
Dexscreen - Python SDK for DexScreener API
|
3
|
+
|
4
|
+
A modern, stable, and reliable Python SDK for DexScreener API with HTTP support.
|
5
|
+
"""
|
6
|
+
|
7
|
+
from .api.client import DexscreenerClient
|
8
|
+
from .core.exceptions import (
|
9
|
+
# API errors
|
10
|
+
APIError,
|
11
|
+
APILimitError,
|
12
|
+
AuthenticationError,
|
13
|
+
# Configuration errors
|
14
|
+
ConfigurationError,
|
15
|
+
ConnectionError,
|
16
|
+
DataFormatError,
|
17
|
+
# Base exceptions
|
18
|
+
DexscreenError,
|
19
|
+
FilterConfigError,
|
20
|
+
HttpConnectionError,
|
21
|
+
# HTTP errors
|
22
|
+
HttpError,
|
23
|
+
HttpRequestError,
|
24
|
+
HttpResponseParsingError,
|
25
|
+
HttpSessionError,
|
26
|
+
HttpTimeoutError,
|
27
|
+
InvalidAddressError,
|
28
|
+
InvalidChainError,
|
29
|
+
InvalidConfigError,
|
30
|
+
InvalidResponseError,
|
31
|
+
MissingConfigError,
|
32
|
+
MissingDataError,
|
33
|
+
# Network errors
|
34
|
+
NetworkError,
|
35
|
+
ProxyError,
|
36
|
+
RateLimitError,
|
37
|
+
ServerError,
|
38
|
+
StreamConnectionError,
|
39
|
+
StreamDataError,
|
40
|
+
# Streaming errors
|
41
|
+
StreamError,
|
42
|
+
StreamTimeoutError,
|
43
|
+
SubscriptionError,
|
44
|
+
TimeoutError,
|
45
|
+
# Validation errors
|
46
|
+
ValidationError,
|
47
|
+
# Utility functions
|
48
|
+
get_error_category,
|
49
|
+
is_retryable_error,
|
50
|
+
should_wait_before_retry,
|
51
|
+
)
|
52
|
+
from .core.models import (
|
53
|
+
BaseToken,
|
54
|
+
Liquidity,
|
55
|
+
PairTransactionCounts,
|
56
|
+
PriceChangePeriods,
|
57
|
+
TokenPair,
|
58
|
+
TransactionCount,
|
59
|
+
VolumeChangePeriods,
|
60
|
+
)
|
61
|
+
from .utils.filters import FilterConfig, FilterPresets
|
62
|
+
|
63
|
+
__version__ = "1.0.0"
|
64
|
+
__all__ = [
|
65
|
+
# API errors
|
66
|
+
"APIError",
|
67
|
+
"APILimitError",
|
68
|
+
"AuthenticationError",
|
69
|
+
# Core models and client
|
70
|
+
"BaseToken",
|
71
|
+
# Configuration errors
|
72
|
+
"ConfigurationError",
|
73
|
+
"ConnectionError",
|
74
|
+
"DataFormatError",
|
75
|
+
# Base exceptions
|
76
|
+
"DexscreenError",
|
77
|
+
"DexscreenerClient",
|
78
|
+
"FilterConfig",
|
79
|
+
"FilterConfigError",
|
80
|
+
"FilterPresets",
|
81
|
+
"HttpConnectionError",
|
82
|
+
# HTTP errors
|
83
|
+
"HttpError",
|
84
|
+
"HttpRequestError",
|
85
|
+
"HttpResponseParsingError",
|
86
|
+
"HttpSessionError",
|
87
|
+
"HttpTimeoutError",
|
88
|
+
"InvalidAddressError",
|
89
|
+
"InvalidChainError",
|
90
|
+
"InvalidConfigError",
|
91
|
+
"InvalidResponseError",
|
92
|
+
"Liquidity",
|
93
|
+
"MissingConfigError",
|
94
|
+
"MissingDataError",
|
95
|
+
# Network errors
|
96
|
+
"NetworkError",
|
97
|
+
"PairTransactionCounts",
|
98
|
+
"PriceChangePeriods",
|
99
|
+
"ProxyError",
|
100
|
+
"RateLimitError",
|
101
|
+
"ServerError",
|
102
|
+
"StreamConnectionError",
|
103
|
+
"StreamDataError",
|
104
|
+
# Streaming errors
|
105
|
+
"StreamError",
|
106
|
+
"StreamTimeoutError",
|
107
|
+
"SubscriptionError",
|
108
|
+
"TimeoutError",
|
109
|
+
"TokenPair",
|
110
|
+
"TransactionCount",
|
111
|
+
# Validation errors
|
112
|
+
"ValidationError",
|
113
|
+
"VolumeChangePeriods",
|
114
|
+
# Utility functions
|
115
|
+
"get_error_category",
|
116
|
+
"is_retryable_error",
|
117
|
+
"should_wait_before_retry",
|
118
|
+
]
|