simplex 1.2.45__py3-none-any.whl → 1.2.49__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 simplex might be problematic. Click here for more details.
- simplex/simplex.py +26 -6
- {simplex-1.2.45.dist-info → simplex-1.2.49.dist-info}/METADATA +5 -9
- simplex-1.2.49.dist-info/RECORD +10 -0
- simplex-1.2.45.dist-info/RECORD +0 -11
- simplex-1.2.45.dist-info/entry_points.txt +0 -2
- {simplex-1.2.45.dist-info → simplex-1.2.49.dist-info}/LICENSE +0 -0
- {simplex-1.2.45.dist-info → simplex-1.2.49.dist-info}/WHEEL +0 -0
- {simplex-1.2.45.dist-info → simplex-1.2.49.dist-info}/top_level.txt +0 -0
simplex/simplex.py
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
import atexit
|
|
3
3
|
from typing import Optional
|
|
4
|
-
from playwright.sync_api import sync_playwright
|
|
5
4
|
import os
|
|
6
5
|
import json
|
|
6
|
+
import warnings
|
|
7
|
+
|
|
8
|
+
# Try to import playwright, but don't fail if it's not available (lite version)
|
|
9
|
+
try:
|
|
10
|
+
from playwright.sync_api import sync_playwright
|
|
11
|
+
PLAYWRIGHT_AVAILABLE = True
|
|
12
|
+
except ImportError:
|
|
13
|
+
PLAYWRIGHT_AVAILABLE = False
|
|
14
|
+
warnings.warn(
|
|
15
|
+
"Playwright is not available. Some features will be disabled. "
|
|
16
|
+
"To enable all features, install with 'pip install simplex[playwright]'",
|
|
17
|
+
ImportWarning
|
|
18
|
+
)
|
|
7
19
|
|
|
8
20
|
BASE_URL = "https://api.simplex.sh"
|
|
9
21
|
|
|
@@ -59,18 +71,23 @@ class Simplex:
|
|
|
59
71
|
self.api_key = api_key
|
|
60
72
|
self.session_id = None
|
|
61
73
|
atexit.register(self.close_session)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
if PLAYWRIGHT_AVAILABLE:
|
|
75
|
+
self.playwright = Playwright(self)
|
|
76
|
+
self.pw_browser = None
|
|
77
|
+
self.pw = None
|
|
78
|
+
else:
|
|
79
|
+
self.playwright = None
|
|
80
|
+
self.pw_browser = None
|
|
81
|
+
self.pw = None
|
|
65
82
|
|
|
66
83
|
def close_session(self):
|
|
67
|
-
if self.pw_browser:
|
|
84
|
+
if PLAYWRIGHT_AVAILABLE and self.pw_browser:
|
|
68
85
|
try:
|
|
69
86
|
self.pw_browser.close()
|
|
70
87
|
self.pw_browser = None
|
|
71
88
|
except Exception as e:
|
|
72
89
|
print(f"Failed to close pw_browser: {e}")
|
|
73
|
-
if self.pw:
|
|
90
|
+
if PLAYWRIGHT_AVAILABLE and self.pw:
|
|
74
91
|
try:
|
|
75
92
|
self.pw.stop()
|
|
76
93
|
self.pw = None
|
|
@@ -421,6 +438,9 @@ class Simplex:
|
|
|
421
438
|
raise ValueError(f"Failed to wait: {response.json()['error']}")
|
|
422
439
|
|
|
423
440
|
def create_login_session(self, url: str, save_directory: Optional[str] = None):
|
|
441
|
+
if not PLAYWRIGHT_AVAILABLE:
|
|
442
|
+
raise ImportError("This feature requires playwright. Install simplex[playwright] to use it.")
|
|
443
|
+
|
|
424
444
|
def get_website_name(url: str) -> str:
|
|
425
445
|
"""Extract website name from URL"""
|
|
426
446
|
from urllib.parse import urlparse
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: simplex
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.49
|
|
4
4
|
Summary: Official Python SDK for Simplex API
|
|
5
5
|
Home-page: https://simplex.sh
|
|
6
6
|
Author: Simplex Labs, Inc.
|
|
7
|
-
Author-email: founders@simplex.sh
|
|
7
|
+
Author-email: "Simplex Labs, Inc." <founders@simplex.sh>
|
|
8
|
+
Project-URL: Homepage, https://simplex.sh
|
|
8
9
|
Classifier: Programming Language :: Python :: 3
|
|
9
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -17,16 +18,11 @@ Requires-Dist: colorama
|
|
|
17
18
|
Requires-Dist: requests
|
|
18
19
|
Requires-Dist: python-dotenv
|
|
19
20
|
Requires-Dist: click
|
|
20
|
-
|
|
21
|
+
Provides-Extra: playwright
|
|
22
|
+
Requires-Dist: playwright>=1.0.0; extra == "playwright"
|
|
21
23
|
Dynamic: author
|
|
22
|
-
Dynamic: author-email
|
|
23
|
-
Dynamic: classifier
|
|
24
|
-
Dynamic: description
|
|
25
|
-
Dynamic: description-content-type
|
|
26
24
|
Dynamic: home-page
|
|
27
|
-
Dynamic: requires-dist
|
|
28
25
|
Dynamic: requires-python
|
|
29
|
-
Dynamic: summary
|
|
30
26
|
|
|
31
27
|
# Simplex AI Python SDK
|
|
32
28
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
|
|
2
|
+
simplex/cli.py,sha256=0K_pzoVdF7vfTJPUONhFzzTvjZk2M7FZPpEONjZWJC8,2268
|
|
3
|
+
simplex/simplex.py,sha256=8TgJqOZN2K6Eh82yCPZ3-BD9ogabXkCWDDcSTxQp4c0,24227
|
|
4
|
+
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
+
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
+
simplex-1.2.49.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
+
simplex-1.2.49.dist-info/METADATA,sha256=qErOD2AsNuwsdcaiTlEhT6_jbQ80B50Ny5_xbtBOxY0,949
|
|
8
|
+
simplex-1.2.49.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
+
simplex-1.2.49.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
10
|
+
simplex-1.2.49.dist-info/RECORD,,
|
simplex-1.2.45.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
|
|
2
|
-
simplex/cli.py,sha256=0K_pzoVdF7vfTJPUONhFzzTvjZk2M7FZPpEONjZWJC8,2268
|
|
3
|
-
simplex/simplex.py,sha256=-S9b8L0-XQQs9qtHuVN8Q8YFbZCEle4HTRNV3QvLU70,23477
|
|
4
|
-
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
-
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
-
simplex-1.2.45.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
-
simplex-1.2.45.dist-info/METADATA,sha256=b2Z4E1RSBEQY_X1s6tByyAr4qBvc_LOnR5N2DDrvhys,964
|
|
8
|
-
simplex-1.2.45.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
-
simplex-1.2.45.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
10
|
-
simplex-1.2.45.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
11
|
-
simplex-1.2.45.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|