simplex 1.2.80__tar.gz → 2.0.0__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.
- {simplex-1.2.80 → simplex-2.0.0}/LICENSE +2 -2
- simplex-2.0.0/MANIFEST.in +6 -0
- simplex-2.0.0/PKG-INFO +224 -0
- simplex-2.0.0/README.md +193 -0
- simplex-2.0.0/pyproject.toml +56 -0
- simplex-2.0.0/requirements.txt +6 -0
- simplex-2.0.0/simplex/__init__.py +50 -0
- simplex-2.0.0/simplex/_http_client.py +220 -0
- simplex-2.0.0/simplex/client.py +289 -0
- simplex-2.0.0/simplex/errors.py +119 -0
- simplex-2.0.0/simplex/types.py +64 -0
- simplex-2.0.0/simplex.egg-info/PKG-INFO +224 -0
- {simplex-1.2.80 → simplex-2.0.0}/simplex.egg-info/SOURCES.txt +8 -7
- simplex-2.0.0/simplex.egg-info/requires.txt +6 -0
- simplex-1.2.80/PKG-INFO +0 -37
- simplex-1.2.80/README.md +0 -5
- simplex-1.2.80/setup.py +0 -62
- simplex-1.2.80/simplex/__init__.py +0 -4
- simplex-1.2.80/simplex/cli.py +0 -77
- simplex-1.2.80/simplex/deploy/__init__.py +0 -3
- simplex-1.2.80/simplex/deploy/push.py +0 -208
- simplex-1.2.80/simplex/simplex.py +0 -1015
- simplex-1.2.80/simplex.egg-info/PKG-INFO +0 -37
- simplex-1.2.80/simplex.egg-info/entry_points.txt +0 -2
- simplex-1.2.80/simplex.egg-info/requires.txt +0 -7
- {simplex-1.2.80 → simplex-2.0.0}/setup.cfg +0 -0
- {simplex-1.2.80 → simplex-2.0.0}/simplex.egg-info/dependency_links.txt +0 -0
- {simplex-1.2.80 → simplex-2.0.0}/simplex.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2024 Simplex
|
|
3
|
+
Copyright (c) 2024 Simplex
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
simplex-2.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simplex
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Official Python SDK for the Simplex API
|
|
5
|
+
Author-email: Simplex <support@simplex.sh>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://simplex.sh
|
|
8
|
+
Project-URL: Documentation, https://docs.simplex.sh
|
|
9
|
+
Project-URL: Repository, https://github.com/simplexlabs/simplex-python
|
|
10
|
+
Keywords: simplex,api,sdk,workflow,automation,browser,scraping
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: requests>=2.25.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
29
|
+
Requires-Dist: types-requests>=2.25.0; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# Simplex Python SDK
|
|
33
|
+
|
|
34
|
+
Official Python SDK for the [Simplex API](https://simplex.sh) - A powerful workflow automation platform for browser-based tasks.
|
|
35
|
+
|
|
36
|
+
[](https://www.python.org/downloads/)
|
|
37
|
+
[](https://opensource.org/licenses/MIT)
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install simplex
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
import time
|
|
49
|
+
from simplex import SimplexClient
|
|
50
|
+
|
|
51
|
+
# Initialize the client
|
|
52
|
+
client = SimplexClient(api_key="your-api-key")
|
|
53
|
+
|
|
54
|
+
# Run a workflow
|
|
55
|
+
response = client.run_workflow(
|
|
56
|
+
"workflow-id",
|
|
57
|
+
variables={"email": "user@example.com"}
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
print(f"Session started: {response['session_id']}")
|
|
61
|
+
|
|
62
|
+
# Poll for completion
|
|
63
|
+
while True:
|
|
64
|
+
status = client.get_session_status(response["session_id"])
|
|
65
|
+
if not status["in_progress"]:
|
|
66
|
+
break
|
|
67
|
+
time.sleep(1)
|
|
68
|
+
|
|
69
|
+
# Check results
|
|
70
|
+
if status["success"]:
|
|
71
|
+
print("Success!")
|
|
72
|
+
print("Scraper outputs:", status["scraper_outputs"])
|
|
73
|
+
print("File metadata:", status["file_metadata"])
|
|
74
|
+
else:
|
|
75
|
+
print("Failed")
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## API Reference
|
|
79
|
+
|
|
80
|
+
### SimplexClient
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
client = SimplexClient(
|
|
84
|
+
api_key="your-api-key",
|
|
85
|
+
base_url="https://api.simplex.sh", # Optional
|
|
86
|
+
timeout=30, # Request timeout in seconds
|
|
87
|
+
max_retries=3, # Retry attempts for failed requests
|
|
88
|
+
retry_delay=1.0, # Delay between retries in seconds
|
|
89
|
+
)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Methods
|
|
93
|
+
|
|
94
|
+
#### `run_workflow(workflow_id, variables=None, metadata=None, webhook_url=None)`
|
|
95
|
+
|
|
96
|
+
Run a workflow by its ID.
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
response = client.run_workflow(
|
|
100
|
+
"workflow-id",
|
|
101
|
+
variables={"key": "value"},
|
|
102
|
+
metadata="optional metadata",
|
|
103
|
+
webhook_url="https://your-webhook.com/callback"
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
print(response["session_id"]) # Session ID for polling
|
|
107
|
+
print(response["vnc_url"]) # VNC URL to watch the session
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### `get_session_status(session_id)`
|
|
111
|
+
|
|
112
|
+
Get the status of a running or completed session.
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
status = client.get_session_status("session-id")
|
|
116
|
+
|
|
117
|
+
print(status["in_progress"]) # True while running
|
|
118
|
+
print(status["success"]) # True/False when complete, None while running
|
|
119
|
+
print(status["scraper_outputs"]) # Data collected by scrapers
|
|
120
|
+
print(status["file_metadata"]) # Metadata for downloaded files
|
|
121
|
+
print(status["metadata"]) # Custom metadata
|
|
122
|
+
print(status["workflow_metadata"]) # Workflow metadata
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### `download_session_files(session_id, filename=None)`
|
|
126
|
+
|
|
127
|
+
Download files from a completed session.
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
# Download all files as a zip
|
|
131
|
+
zip_data = client.download_session_files("session-id")
|
|
132
|
+
with open("files.zip", "wb") as f:
|
|
133
|
+
f.write(zip_data)
|
|
134
|
+
|
|
135
|
+
# Download a specific file
|
|
136
|
+
pdf_data = client.download_session_files("session-id", filename="report.pdf")
|
|
137
|
+
with open("report.pdf", "wb") as f:
|
|
138
|
+
f.write(pdf_data)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### `retrieve_session_replay(session_id)`
|
|
142
|
+
|
|
143
|
+
Download the session replay video (MP4).
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
video = client.retrieve_session_replay("session-id")
|
|
147
|
+
with open("replay.mp4", "wb") as f:
|
|
148
|
+
f.write(video)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### `retrieve_session_logs(session_id)`
|
|
152
|
+
|
|
153
|
+
Get the session logs as parsed JSON.
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
logs = client.retrieve_session_logs("session-id")
|
|
157
|
+
for entry in logs:
|
|
158
|
+
print(f"{entry['timestamp']}: {entry['message']}")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Error Handling
|
|
162
|
+
|
|
163
|
+
The SDK provides specific exception types for different error scenarios:
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
from simplex import (
|
|
167
|
+
SimplexClient,
|
|
168
|
+
SimplexError,
|
|
169
|
+
WorkflowError,
|
|
170
|
+
AuthenticationError,
|
|
171
|
+
RateLimitError,
|
|
172
|
+
NetworkError,
|
|
173
|
+
ValidationError,
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
client = SimplexClient(api_key="your-api-key")
|
|
177
|
+
|
|
178
|
+
try:
|
|
179
|
+
result = client.run_workflow("workflow-id")
|
|
180
|
+
except AuthenticationError as e:
|
|
181
|
+
print(f"Invalid API key: {e.message}")
|
|
182
|
+
except RateLimitError as e:
|
|
183
|
+
print(f"Rate limited. Retry after {e.retry_after} seconds")
|
|
184
|
+
except ValidationError as e:
|
|
185
|
+
print(f"Invalid request: {e.message}")
|
|
186
|
+
except WorkflowError as e:
|
|
187
|
+
print(f"Workflow error: {e.message}")
|
|
188
|
+
print(f"Session ID: {e.session_id}")
|
|
189
|
+
except NetworkError as e:
|
|
190
|
+
print(f"Network error: {e.message}")
|
|
191
|
+
except SimplexError as e:
|
|
192
|
+
print(f"General error: {e.message}")
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Type Hints
|
|
196
|
+
|
|
197
|
+
The SDK includes full type hints for better IDE support:
|
|
198
|
+
|
|
199
|
+
```python
|
|
200
|
+
from simplex import (
|
|
201
|
+
SimplexClient,
|
|
202
|
+
SessionStatusResponse,
|
|
203
|
+
RunWorkflowResponse,
|
|
204
|
+
FileMetadata,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
client = SimplexClient(api_key="your-api-key")
|
|
208
|
+
response: RunWorkflowResponse = client.run_workflow("workflow-id")
|
|
209
|
+
status: SessionStatusResponse = client.get_session_status(response["session_id"])
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Requirements
|
|
213
|
+
|
|
214
|
+
- Python 3.9+
|
|
215
|
+
- `requests>=2.25.0`
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
220
|
+
|
|
221
|
+
## Support
|
|
222
|
+
|
|
223
|
+
- Documentation: [https://docs.simplex.sh](https://docs.simplex.sh)
|
|
224
|
+
- Email: support@simplex.sh
|
simplex-2.0.0/README.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Simplex Python SDK
|
|
2
|
+
|
|
3
|
+
Official Python SDK for the [Simplex API](https://simplex.sh) - A powerful workflow automation platform for browser-based tasks.
|
|
4
|
+
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install simplex
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
import time
|
|
18
|
+
from simplex import SimplexClient
|
|
19
|
+
|
|
20
|
+
# Initialize the client
|
|
21
|
+
client = SimplexClient(api_key="your-api-key")
|
|
22
|
+
|
|
23
|
+
# Run a workflow
|
|
24
|
+
response = client.run_workflow(
|
|
25
|
+
"workflow-id",
|
|
26
|
+
variables={"email": "user@example.com"}
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
print(f"Session started: {response['session_id']}")
|
|
30
|
+
|
|
31
|
+
# Poll for completion
|
|
32
|
+
while True:
|
|
33
|
+
status = client.get_session_status(response["session_id"])
|
|
34
|
+
if not status["in_progress"]:
|
|
35
|
+
break
|
|
36
|
+
time.sleep(1)
|
|
37
|
+
|
|
38
|
+
# Check results
|
|
39
|
+
if status["success"]:
|
|
40
|
+
print("Success!")
|
|
41
|
+
print("Scraper outputs:", status["scraper_outputs"])
|
|
42
|
+
print("File metadata:", status["file_metadata"])
|
|
43
|
+
else:
|
|
44
|
+
print("Failed")
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## API Reference
|
|
48
|
+
|
|
49
|
+
### SimplexClient
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
client = SimplexClient(
|
|
53
|
+
api_key="your-api-key",
|
|
54
|
+
base_url="https://api.simplex.sh", # Optional
|
|
55
|
+
timeout=30, # Request timeout in seconds
|
|
56
|
+
max_retries=3, # Retry attempts for failed requests
|
|
57
|
+
retry_delay=1.0, # Delay between retries in seconds
|
|
58
|
+
)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Methods
|
|
62
|
+
|
|
63
|
+
#### `run_workflow(workflow_id, variables=None, metadata=None, webhook_url=None)`
|
|
64
|
+
|
|
65
|
+
Run a workflow by its ID.
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
response = client.run_workflow(
|
|
69
|
+
"workflow-id",
|
|
70
|
+
variables={"key": "value"},
|
|
71
|
+
metadata="optional metadata",
|
|
72
|
+
webhook_url="https://your-webhook.com/callback"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
print(response["session_id"]) # Session ID for polling
|
|
76
|
+
print(response["vnc_url"]) # VNC URL to watch the session
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### `get_session_status(session_id)`
|
|
80
|
+
|
|
81
|
+
Get the status of a running or completed session.
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
status = client.get_session_status("session-id")
|
|
85
|
+
|
|
86
|
+
print(status["in_progress"]) # True while running
|
|
87
|
+
print(status["success"]) # True/False when complete, None while running
|
|
88
|
+
print(status["scraper_outputs"]) # Data collected by scrapers
|
|
89
|
+
print(status["file_metadata"]) # Metadata for downloaded files
|
|
90
|
+
print(status["metadata"]) # Custom metadata
|
|
91
|
+
print(status["workflow_metadata"]) # Workflow metadata
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### `download_session_files(session_id, filename=None)`
|
|
95
|
+
|
|
96
|
+
Download files from a completed session.
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
# Download all files as a zip
|
|
100
|
+
zip_data = client.download_session_files("session-id")
|
|
101
|
+
with open("files.zip", "wb") as f:
|
|
102
|
+
f.write(zip_data)
|
|
103
|
+
|
|
104
|
+
# Download a specific file
|
|
105
|
+
pdf_data = client.download_session_files("session-id", filename="report.pdf")
|
|
106
|
+
with open("report.pdf", "wb") as f:
|
|
107
|
+
f.write(pdf_data)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### `retrieve_session_replay(session_id)`
|
|
111
|
+
|
|
112
|
+
Download the session replay video (MP4).
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
video = client.retrieve_session_replay("session-id")
|
|
116
|
+
with open("replay.mp4", "wb") as f:
|
|
117
|
+
f.write(video)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### `retrieve_session_logs(session_id)`
|
|
121
|
+
|
|
122
|
+
Get the session logs as parsed JSON.
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
logs = client.retrieve_session_logs("session-id")
|
|
126
|
+
for entry in logs:
|
|
127
|
+
print(f"{entry['timestamp']}: {entry['message']}")
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Error Handling
|
|
131
|
+
|
|
132
|
+
The SDK provides specific exception types for different error scenarios:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from simplex import (
|
|
136
|
+
SimplexClient,
|
|
137
|
+
SimplexError,
|
|
138
|
+
WorkflowError,
|
|
139
|
+
AuthenticationError,
|
|
140
|
+
RateLimitError,
|
|
141
|
+
NetworkError,
|
|
142
|
+
ValidationError,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
client = SimplexClient(api_key="your-api-key")
|
|
146
|
+
|
|
147
|
+
try:
|
|
148
|
+
result = client.run_workflow("workflow-id")
|
|
149
|
+
except AuthenticationError as e:
|
|
150
|
+
print(f"Invalid API key: {e.message}")
|
|
151
|
+
except RateLimitError as e:
|
|
152
|
+
print(f"Rate limited. Retry after {e.retry_after} seconds")
|
|
153
|
+
except ValidationError as e:
|
|
154
|
+
print(f"Invalid request: {e.message}")
|
|
155
|
+
except WorkflowError as e:
|
|
156
|
+
print(f"Workflow error: {e.message}")
|
|
157
|
+
print(f"Session ID: {e.session_id}")
|
|
158
|
+
except NetworkError as e:
|
|
159
|
+
print(f"Network error: {e.message}")
|
|
160
|
+
except SimplexError as e:
|
|
161
|
+
print(f"General error: {e.message}")
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Type Hints
|
|
165
|
+
|
|
166
|
+
The SDK includes full type hints for better IDE support:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from simplex import (
|
|
170
|
+
SimplexClient,
|
|
171
|
+
SessionStatusResponse,
|
|
172
|
+
RunWorkflowResponse,
|
|
173
|
+
FileMetadata,
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
client = SimplexClient(api_key="your-api-key")
|
|
177
|
+
response: RunWorkflowResponse = client.run_workflow("workflow-id")
|
|
178
|
+
status: SessionStatusResponse = client.get_session_status(response["session_id"])
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Requirements
|
|
182
|
+
|
|
183
|
+
- Python 3.9+
|
|
184
|
+
- `requests>=2.25.0`
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
189
|
+
|
|
190
|
+
## Support
|
|
191
|
+
|
|
192
|
+
- Documentation: [https://docs.simplex.sh](https://docs.simplex.sh)
|
|
193
|
+
- Email: support@simplex.sh
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=45", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "simplex"
|
|
7
|
+
version = "2.0.0"
|
|
8
|
+
description = "Official Python SDK for the Simplex API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Simplex", email = "support@simplex.sh"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["simplex", "api", "sdk", "workflow", "automation", "browser", "scraping"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
]
|
|
29
|
+
dependencies = [
|
|
30
|
+
"requests>=2.25.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"pytest>=7.0.0",
|
|
36
|
+
"mypy>=1.0.0",
|
|
37
|
+
"types-requests>=2.25.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
Homepage = "https://simplex.sh"
|
|
42
|
+
Documentation = "https://docs.simplex.sh"
|
|
43
|
+
Repository = "https://github.com/simplexlabs/simplex-python"
|
|
44
|
+
|
|
45
|
+
[tool.mypy]
|
|
46
|
+
python_version = "3.9"
|
|
47
|
+
warn_return_any = true
|
|
48
|
+
warn_unused_configs = true
|
|
49
|
+
disallow_untyped_defs = true
|
|
50
|
+
strict = true
|
|
51
|
+
|
|
52
|
+
[tool.pytest.ini_options]
|
|
53
|
+
testpaths = ["tests"]
|
|
54
|
+
python_files = ["test_*.py"]
|
|
55
|
+
python_classes = ["Test*"]
|
|
56
|
+
python_functions = ["test_*"]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Simplex Python SDK
|
|
3
|
+
|
|
4
|
+
Official Python SDK for the Simplex API - A workflow automation platform.
|
|
5
|
+
|
|
6
|
+
Example usage:
|
|
7
|
+
>>> from simplex import SimplexClient
|
|
8
|
+
>>> client = SimplexClient(api_key="your-api-key")
|
|
9
|
+
>>> result = client.run_workflow("workflow-id", variables={"key": "value"})
|
|
10
|
+
>>>
|
|
11
|
+
>>> # Poll for completion
|
|
12
|
+
>>> import time
|
|
13
|
+
>>> while True:
|
|
14
|
+
... status = client.get_session_status(result["session_id"])
|
|
15
|
+
... if not status["in_progress"]:
|
|
16
|
+
... break
|
|
17
|
+
... time.sleep(1)
|
|
18
|
+
>>>
|
|
19
|
+
>>> if status["success"]:
|
|
20
|
+
... print("Outputs:", status["scraper_outputs"])
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from simplex.client import SimplexClient
|
|
24
|
+
from simplex.errors import (
|
|
25
|
+
AuthenticationError,
|
|
26
|
+
NetworkError,
|
|
27
|
+
RateLimitError,
|
|
28
|
+
SimplexError,
|
|
29
|
+
ValidationError,
|
|
30
|
+
WorkflowError,
|
|
31
|
+
)
|
|
32
|
+
from simplex.types import (
|
|
33
|
+
FileMetadata,
|
|
34
|
+
RunWorkflowResponse,
|
|
35
|
+
SessionStatusResponse,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
__version__ = "2.0.0"
|
|
39
|
+
__all__ = [
|
|
40
|
+
"SimplexClient",
|
|
41
|
+
"SimplexError",
|
|
42
|
+
"NetworkError",
|
|
43
|
+
"ValidationError",
|
|
44
|
+
"AuthenticationError",
|
|
45
|
+
"RateLimitError",
|
|
46
|
+
"WorkflowError",
|
|
47
|
+
"FileMetadata",
|
|
48
|
+
"SessionStatusResponse",
|
|
49
|
+
"RunWorkflowResponse",
|
|
50
|
+
]
|