scalebox-sdk 0.1.16__py3-none-any.whl → 0.1.18__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.
scalebox/__init__.py CHANGED
@@ -9,7 +9,7 @@ A multi-language code execution sandbox with support for:
9
9
  - Real-time callbacks and monitoring
10
10
  """
11
11
 
12
- __version__ = "0.1.16"
12
+ __version__ = "0.1.18"
13
13
  __author__ = "ScaleBox Team"
14
14
  __email__ = "dev@scalebox.dev"
15
15
 
@@ -272,7 +272,7 @@ class Sandbox(BaseSandbox):
272
272
  create_context_request,
273
273
  timeout_seconds=request_timeout
274
274
  or self._connection_config.request_timeout,
275
- extra_headers=headers,
275
+ extra_headers=self.connection_config.headers,
276
276
  )
277
277
 
278
278
  return Context.from_json(
@@ -1,92 +1,92 @@
1
- import os
2
- from typing import Dict, Literal, Optional
3
-
4
- from httpx._types import ProxyTypes
5
-
6
- # from .api.metadata import package_version
7
-
8
- REQUEST_TIMEOUT: float = 30.0 # 30 seconds
9
-
10
- KEEPALIVE_PING_INTERVAL_SEC = 50 # 50 seconds
11
- KEEPALIVE_PING_HEADER = "Keepalive-Ping-Interval"
12
-
13
-
14
- class ConnectionConfig:
15
- """
16
- Configuration for the connection to the API.
17
- """
18
-
19
- @staticmethod
20
- def _domain():
21
- return os.getenv("CSX_DOMAIN") or "api.scalebox.dev/v1"
22
-
23
- @staticmethod
24
- def _debug():
25
- return os.getenv("CSX_DEBUG", "false").lower() == "true"
26
-
27
- @staticmethod
28
- def _api_key():
29
- return os.getenv("CSX_API_KEY")
30
-
31
- @staticmethod
32
- def _access_token():
33
- return os.getenv("CSX_ACCESS_TOKEN")
34
-
35
- def __init__(
36
- self,
37
- domain: Optional[str] = None,
38
- debug: Optional[bool] = None,
39
- api_key: Optional[str] = None,
40
- access_token: Optional[str] = None,
41
- request_timeout: Optional[float] = None,
42
- headers: Optional[Dict[str, str]] = None,
43
- proxy: Optional[ProxyTypes] = None,
44
- ):
45
- self.domain = domain or ConnectionConfig._domain()
46
- self.debug = debug or ConnectionConfig._debug()
47
- self.api_key = api_key or ConnectionConfig._api_key()
48
- self.access_token = access_token or ConnectionConfig._access_token()
49
- self.headers = headers or {}
50
- # self.headers["User-Agent"] = f"csx-python-sdk/{package_version}"
51
-
52
- self.proxy = proxy
53
-
54
- self.request_timeout = ConnectionConfig._get_request_timeout(
55
- REQUEST_TIMEOUT,
56
- request_timeout,
57
- )
58
-
59
- if request_timeout == 0:
60
- self.request_timeout = None
61
- elif request_timeout is not None:
62
- self.request_timeout = request_timeout
63
- else:
64
- self.request_timeout = REQUEST_TIMEOUT
65
-
66
- self.api_url = f"https://{self.domain}"
67
-
68
- @staticmethod
69
- def _get_request_timeout(
70
- default_timeout: Optional[float],
71
- request_timeout: Optional[float],
72
- ):
73
- if request_timeout == 0:
74
- return None
75
- elif request_timeout is not None:
76
- return request_timeout
77
- else:
78
- return default_timeout
79
-
80
- def get_request_timeout(self, request_timeout: Optional[float] = None):
81
- return self._get_request_timeout(self.request_timeout, request_timeout)
82
-
83
-
84
- Username = Literal["root", "user"]
85
- """
86
- User used for the operation in the sandbox.
87
- """
88
-
89
- default_username: Username = "user"
90
- """
91
- Default user used for the operation in the sandbox.
92
- """
1
+ import os
2
+ from typing import Dict, Literal, Optional
3
+
4
+ from httpx._types import ProxyTypes
5
+
6
+ # from .api.metadata import package_version
7
+
8
+ REQUEST_TIMEOUT: float = 30.0 # 30 seconds
9
+
10
+ KEEPALIVE_PING_INTERVAL_SEC = 50 # 50 seconds
11
+ KEEPALIVE_PING_HEADER = "Keepalive-Ping-Interval"
12
+
13
+
14
+ class ConnectionConfig:
15
+ """
16
+ Configuration for the connection to the API.
17
+ """
18
+
19
+ @staticmethod
20
+ def _domain():
21
+ return os.getenv("SBX_DOMAIN") or "api.scalebox.dev/v1"
22
+
23
+ @staticmethod
24
+ def _debug():
25
+ return os.getenv("SBX_DEBUG", "false").lower() == "true"
26
+
27
+ @staticmethod
28
+ def _api_key():
29
+ return os.getenv("SBX_API_KEY")
30
+
31
+ @staticmethod
32
+ def _access_token():
33
+ return os.getenv("SBX_ACCESS_TOKEN")
34
+
35
+ def __init__(
36
+ self,
37
+ domain: Optional[str] = None,
38
+ debug: Optional[bool] = None,
39
+ api_key: Optional[str] = None,
40
+ access_token: Optional[str] = None,
41
+ request_timeout: Optional[float] = None,
42
+ headers: Optional[Dict[str, str]] = None,
43
+ proxy: Optional[ProxyTypes] = None,
44
+ ):
45
+ self.domain = domain or ConnectionConfig._domain()
46
+ self.debug = debug or ConnectionConfig._debug()
47
+ self.api_key = api_key or ConnectionConfig._api_key()
48
+ self.access_token = access_token or ConnectionConfig._access_token()
49
+ self.headers = headers or {}
50
+ # self.headers["User-Agent"] = f"csx-python-sdk/{package_version}"
51
+
52
+ self.proxy = proxy
53
+
54
+ self.request_timeout = ConnectionConfig._get_request_timeout(
55
+ REQUEST_TIMEOUT,
56
+ request_timeout,
57
+ )
58
+
59
+ if request_timeout == 0:
60
+ self.request_timeout = None
61
+ elif request_timeout is not None:
62
+ self.request_timeout = request_timeout
63
+ else:
64
+ self.request_timeout = REQUEST_TIMEOUT
65
+
66
+ self.api_url = f"https://{self.domain}"
67
+
68
+ @staticmethod
69
+ def _get_request_timeout(
70
+ default_timeout: Optional[float],
71
+ request_timeout: Optional[float],
72
+ ):
73
+ if request_timeout == 0:
74
+ return None
75
+ elif request_timeout is not None:
76
+ return request_timeout
77
+ else:
78
+ return default_timeout
79
+
80
+ def get_request_timeout(self, request_timeout: Optional[float] = None):
81
+ return self._get_request_timeout(self.request_timeout, request_timeout)
82
+
83
+
84
+ Username = Literal["root", "user"]
85
+ """
86
+ User used for the operation in the sandbox.
87
+ """
88
+
89
+ default_username: Username = "user"
90
+ """
91
+ Default user used for the operation in the sandbox.
92
+ """
scalebox/version.py CHANGED
@@ -2,8 +2,8 @@
2
2
  Version information for ScaleBox Python SDK
3
3
  """
4
4
 
5
- __version__ = "0.1.16"
6
- __version_info__ = (0, 1, 16)
5
+ __version__ = "0.1.18"
6
+ __version_info__ = (0, 1, 18)
7
7
 
8
8
 
9
9
  def get_version() -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scalebox-sdk
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: ScaleBox Python SDK - A multi-language code execution sandbox with Python, R, Node.js, Deno/TypeScript, Java, and Bash support
5
5
  Author-email: ScaleBox Team <dev@scalebox.dev>
6
6
  Maintainer-email: ScaleBox Team <dev@scalebox.dev>
@@ -1,9 +1,9 @@
1
- scalebox/__init__.py,sha256=Erz3FC3Ei5bpYjV7hqdLkpKKh-K9pD9CoTrD8zRrWNU,1812
1
+ scalebox/__init__.py,sha256=zMPSD3xBdCVSkQB5EK1lfMea_O9jyKK2Tm650kIu7fU,1812
2
2
  scalebox/cli.py,sha256=HWIyGuhbP1WZm839CwTysauL78xMBOoatFychxzloxQ,3904
3
- scalebox/connection_config.py,sha256=J49-3tYaaoRDpa1l2dbnW3T8XmLrqEZBPXlraFvPp7I,2563
3
+ scalebox/connection_config.py,sha256=W2hMeXlxUHvR51guqOWEEDv35o4XP8SbLkDXqa20C0M,2655
4
4
  scalebox/exceptions.py,sha256=10R9VXfvgO4XJJnxyzyrzkxliyeEBX0ZC36izXa8R5k,2053
5
5
  scalebox/requirements.txt,sha256=LEYsk2VzoxKR-V44Y6qJuJ3vKdTYS79f1Gv1Ajleifo,567
6
- scalebox/version.py,sha256=cx_qQXSpzgvqofTZ5j97c4rMu_2ycWArg1L59GnhcAM,323
6
+ scalebox/version.py,sha256=3-UD79cfdcz8Ut1NDGea-ARpmdx7wR7Wo9OvaL5w8l0,323
7
7
  scalebox/api/__init__.py,sha256=_9nWyeNg4Y_Z30YpBNoDP6S92YdlO_5xBkrp-we0SIg,4167
8
8
  scalebox/api/metadata.py,sha256=lg5ekfnFZYZoCoJxIPo961HEGVg_rLLRJBbw4ZApM_Y,512
9
9
  scalebox/api/client/__init__.py,sha256=IVRaxvQcdPu1Xxc3t--g3ir3Wl5f3Y0zKMwy1nkKN80,155
@@ -72,7 +72,7 @@ scalebox/client/requirements.txt,sha256=wKvAVEljSzYT7t1PFWlsWHR9I47sAYjx97xU51Nv
72
72
  scalebox/code_interpreter/__init__.py,sha256=DKvHYgCOofNzPCgxK9HRyVpb8l1F1Uc2_DUL9BkcsSs,238
73
73
  scalebox/code_interpreter/charts.py,sha256=tYo53XlaWyjsMRb5tG32PaeGapaG0GQW3826wuXARfo,5511
74
74
  scalebox/code_interpreter/code_interpreter_async.py,sha256=rtsGJlGkczVngjMP4dTGS2rO6sRQ55k8c60y3A0ZUVA,13429
75
- scalebox/code_interpreter/code_interpreter_sync.py,sha256=GRZuFKgeDpJqBrV-idkeEYiQdnbO-WMowmB-PdKEPpM,11868
75
+ scalebox/code_interpreter/code_interpreter_sync.py,sha256=HydYJxVbemH8VwcnuE_8o8_u-mKF_WRWcgFsEBAb8Wg,11891
76
76
  scalebox/code_interpreter/constants.py,sha256=MmEu7Uw2rjIZAayX9gQSC-iFmUaaijNSZ0ADnL1L_EM,81
77
77
  scalebox/code_interpreter/exceptions.py,sha256=9YfZk6EMa_RtfZ8K-BHvbRr2lcFRl6I5FY5WrA5gNqI,410
78
78
  scalebox/code_interpreter/models.py,sha256=so4_kPkouB9ET0MN2LkeTaPWXAXJNQIaz0IEYQMGtbs,14019
@@ -148,9 +148,9 @@ scalebox/test/testsandbox_sync.py,sha256=v1dFAJWKbyLnjIiafTR9TafxJF1gaUk-W2mmQU4
148
148
  scalebox/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
149
  scalebox/utils/httpcoreclient.py,sha256=kjTndd-YECPe3n_G1HfGgitzRwntC21tqtIqZ62V6Lg,9868
150
150
  scalebox/utils/httpxclient.py,sha256=oLpCP2RChvnspS6Unl6ngmpY72yPokTfSqMm9m-7k38,13442
151
- scalebox_sdk-0.1.16.dist-info/licenses/LICENSE,sha256=9zP32kHlBovkfji1R6ptx3H7WjJJvnf4UuwTpfogmsY,1069
152
- scalebox_sdk-0.1.16.dist-info/METADATA,sha256=_xOCbIASL2e2Gxgva-I0Wnh6aWTe_VMrbSPzKrUGMwo,12736
153
- scalebox_sdk-0.1.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
154
- scalebox_sdk-0.1.16.dist-info/entry_points.txt,sha256=g7C1Trcg8EyvAGMnHpJ3alqtZzQuMypYUQVFK13kOFM,47
155
- scalebox_sdk-0.1.16.dist-info/top_level.txt,sha256=CDjlibkbOG-MT-s1TRxs4Xe_iN1m11ii48spB6DOMj4,9
156
- scalebox_sdk-0.1.16.dist-info/RECORD,,
151
+ scalebox_sdk-0.1.18.dist-info/licenses/LICENSE,sha256=9zP32kHlBovkfji1R6ptx3H7WjJJvnf4UuwTpfogmsY,1069
152
+ scalebox_sdk-0.1.18.dist-info/METADATA,sha256=srf4fckB7DtPe2VlXbgPt1E0ANz1GjTtGbSESyStet8,12736
153
+ scalebox_sdk-0.1.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
154
+ scalebox_sdk-0.1.18.dist-info/entry_points.txt,sha256=g7C1Trcg8EyvAGMnHpJ3alqtZzQuMypYUQVFK13kOFM,47
155
+ scalebox_sdk-0.1.18.dist-info/top_level.txt,sha256=CDjlibkbOG-MT-s1TRxs4Xe_iN1m11ii48spB6DOMj4,9
156
+ scalebox_sdk-0.1.18.dist-info/RECORD,,