simplex 1.2.46__py3-none-any.whl → 1.2.50__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 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
- self.playwright = Playwright(self)
63
- self.pw_browser = None
64
- self.pw = None
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
@@ -134,7 +151,8 @@ class Simplex:
134
151
  livestream_url = response_json['livestream_url']
135
152
 
136
153
  # Start Playwright without using context manager
137
- self.pw = sync_playwright().start()
154
+ if PLAYWRIGHT_AVAILABLE:
155
+ self.pw = sync_playwright().start()
138
156
  self.connect_url = response_json['connect_url']
139
157
  # self.pw_browser = self.pw.chromium.connect_over_cdp(response_json['connect_url'])
140
158
 
@@ -421,6 +439,9 @@ class Simplex:
421
439
  raise ValueError(f"Failed to wait: {response.json()['error']}")
422
440
 
423
441
  def create_login_session(self, url: str, save_directory: Optional[str] = None):
442
+ if not PLAYWRIGHT_AVAILABLE:
443
+ raise ImportError("This feature requires playwright. Install simplex[playwright] to use it.")
444
+
424
445
  def get_website_name(url: str) -> str:
425
446
  """Extract website name from URL"""
426
447
  from urllib.parse import urlparse
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.46
3
+ Version: 1.2.50
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
- Requires-Dist: playwright
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=TMZspmze_PUnNyiEb14qFlgDvFFosNNB0JFPIaILrXU,24264
4
+ simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
+ simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
6
+ simplex-1.2.50.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
+ simplex-1.2.50.dist-info/METADATA,sha256=N7uqot2meT31_deLgZdlPETIQk5qHcWqIuJj24Fwiu8,949
8
+ simplex-1.2.50.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
+ simplex-1.2.50.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
10
+ simplex-1.2.50.dist-info/RECORD,,
@@ -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.46.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
- simplex-1.2.46.dist-info/METADATA,sha256=ZFcRRWggDHPc5KQ_XLjZ3_4xKVsP9Qmef_V7zTCfU7A,964
8
- simplex-1.2.46.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- simplex-1.2.46.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
- simplex-1.2.46.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
- simplex-1.2.46.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- simplex = simplex.cli:main