alterlab 2.0.0__tar.gz → 2.0.1__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.
- alterlab-2.0.1/PKG-INFO +17 -0
- alterlab-2.0.1/alterlab/__init__.py +54 -0
- alterlab-2.0.1/alterlab/client.py +1036 -0
- alterlab-2.0.1/pyproject.toml +18 -0
- alterlab-2.0.0/PKG-INFO +0 -375
- alterlab-2.0.0/README.md +0 -342
- alterlab-2.0.0/alterlab/__init__.py +0 -73
- alterlab-2.0.0/alterlab/client.py +0 -1332
- alterlab-2.0.0/pyproject.toml +0 -81
alterlab-2.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: alterlab
|
|
3
|
+
Version: 2.0.1
|
|
4
|
+
Summary: AlterLab Python SDK
|
|
5
|
+
Author: AlterLab
|
|
6
|
+
Author-email: dev@alterlab.io
|
|
7
|
+
Requires-Python: >=3.8,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Dist: httpx (>=0.25.2,<0.26.0)
|
|
17
|
+
Requires-Dist: pydantic (>=2.5.0,<3.0.0)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""AlterLab Python SDK.
|
|
2
|
+
|
|
3
|
+
A production-ready Python client for the AlterLab Scraping API with full feature support.
|
|
4
|
+
|
|
5
|
+
Example:
|
|
6
|
+
import asyncio
|
|
7
|
+
from alterlab import AlterLab, AdvancedOptions, CostControls
|
|
8
|
+
|
|
9
|
+
async def main():
|
|
10
|
+
async with AlterLab(api_key="sk_test_...") as client:
|
|
11
|
+
# Simple scraping
|
|
12
|
+
result = await client.scrape("https://example.com")
|
|
13
|
+
print(result['content'])
|
|
14
|
+
|
|
15
|
+
# Advanced scraping with cost controls
|
|
16
|
+
result = await client.scrape(
|
|
17
|
+
"https://example.com",
|
|
18
|
+
mode="js",
|
|
19
|
+
advanced=AdvancedOptions(render_js=True, screenshot=True),
|
|
20
|
+
cost_controls=CostControls(max_credits=5)
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
asyncio.run(main())
|
|
24
|
+
|
|
25
|
+
For synchronous usage:
|
|
26
|
+
from alterlab import AlterLabSync
|
|
27
|
+
|
|
28
|
+
with AlterLabSync(api_key="sk_test_...") as client:
|
|
29
|
+
result = client.scrape("https://example.com")
|
|
30
|
+
print(result['content'])
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
from alterlab.client import (
|
|
34
|
+
AlterLab,
|
|
35
|
+
AlterLabSync,
|
|
36
|
+
AdvancedOptions,
|
|
37
|
+
CostControls,
|
|
38
|
+
AlterLabError,
|
|
39
|
+
AlterLabAPIError,
|
|
40
|
+
AlterLabTimeoutError,
|
|
41
|
+
AlterLabValidationError
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
__version__ = "2.0.0"
|
|
45
|
+
__all__ = [
|
|
46
|
+
"AlterLab",
|
|
47
|
+
"AlterLabSync",
|
|
48
|
+
"AdvancedOptions",
|
|
49
|
+
"CostControls",
|
|
50
|
+
"AlterLabError",
|
|
51
|
+
"AlterLabAPIError",
|
|
52
|
+
"AlterLabTimeoutError",
|
|
53
|
+
"AlterLabValidationError"
|
|
54
|
+
]
|