simplex 1.2.19__tar.gz → 1.2.21__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.

Potentially problematic release.


This version of simplex might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.19
3
+ Version: 1.2.21
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="simplex",
5
- version="1.2.19",
5
+ version="1.2.21",
6
6
  packages=find_packages(),
7
7
  package_data={
8
8
  "simplex": ["browser_agent/dom/*.js"], # Include JS files in the dom directory
@@ -12,6 +12,8 @@ class Simplex:
12
12
  atexit.register(self.close_session)
13
13
 
14
14
  def close_session(self):
15
+ if not self.session_id:
16
+ return
15
17
  response = requests.post(
16
18
  f"{BASE_URL}/close-session",
17
19
  headers={
@@ -20,10 +22,11 @@ class Simplex:
20
22
  data={'session_id': self.session_id}
21
23
  )
22
24
  self.session_id = None
23
- if response["succeeded"]:
25
+ print(response.json())
26
+ if response.json()["succeeded"]:
24
27
  return
25
28
  else:
26
- raise ValueError(f"Failed to close session: {response['error']}")
29
+ raise ValueError(f"Failed to close session: {response.json()['error']}")
27
30
 
28
31
  def create_session(self, show_in_console: bool = True):
29
32
  response = requests.post(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.19
3
+ Version: 1.2.21
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -12,4 +12,5 @@ simplex.egg-info/entry_points.txt
12
12
  simplex.egg-info/requires.txt
13
13
  simplex.egg-info/top_level.txt
14
14
  simplex/deploy/__init__.py
15
- simplex/deploy/push.py
15
+ simplex/deploy/push.py
16
+ tests/test.py
@@ -0,0 +1,36 @@
1
+ from simplex import Simplex
2
+ import os
3
+ from dotenv import load_dotenv
4
+ import time
5
+
6
+ load_dotenv()
7
+
8
+ def login():
9
+ simplex = Simplex(api_key=os.getenv("SIMPLEX_API_KEY"))
10
+ print(simplex.create_session())
11
+ # simplex.goto("https://browser-tests-alpha.vercel.app/api/upload-test")
12
+ simplex.goto("https://dropbox.com")
13
+ simplex.restore_login_session("dropbox_com_session_data.json")
14
+ simplex.goto("https://dropbox.com/")
15
+ simplex.click("Upload or drop")
16
+ simplex.click_and_upload("File", "ycombinator.svg")
17
+ # print(simplex.exists("Download button"))
18
+ # files = simplex.click_and_download("Download File")
19
+ # import base64
20
+ # print(files)
21
+ # # Decode base64 string to bytes
22
+ # file_bytes = base64.b64decode(files['b64'])
23
+
24
+ # # Create downloads directory if it doesn't exist
25
+ # os.makedirs('downloads', exist_ok=True)
26
+
27
+ # # Write bytes to file
28
+ # with open(os.path.join('downloads', files['filename']), 'wb') as f:
29
+ # f.write(file_bytes)
30
+
31
+ # simplex.goto("https://file-examples.com/wp-content/storage/2018/04/file_example_AVI_480_750kB.avi")
32
+ # print(simplex.restore_login_session("zillow_com_session_data.json"))
33
+ # simplex.goto("https://zillow.com")
34
+
35
+ if __name__ == "__main__":
36
+ login()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes