superposition-sdk 0.92.0__py3-none-any.whl → 0.93.1__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 superposition-sdk might be problematic. Click here for more details.
- superposition_sdk/_private/schemas.py +726 -179
- superposition_sdk/deserialize.py +8 -7
- superposition_sdk/models.py +718 -816
- superposition_sdk/serialize.py +41 -35
- superposition_sdk-0.93.1.dist-info/METADATA +64 -0
- superposition_sdk-0.93.1.dist-info/RECORD +12 -0
- superposition_sdk-0.92.0.dist-info/METADATA +0 -31
- superposition_sdk-0.92.0.dist-info/RECORD +0 -12
- {superposition_sdk-0.92.0.dist-info → superposition_sdk-0.93.1.dist-info}/WHEEL +0 -0
superposition_sdk/serialize.py
CHANGED
|
@@ -171,16 +171,12 @@ async def _serialize_bulk_operation(input: BulkOperationInput, config: Config) -
|
|
|
171
171
|
query: str = f''
|
|
172
172
|
|
|
173
173
|
body: AsyncIterable[bytes] = AsyncBytesReader(b'')
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
content =
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
body = SeekableAsyncBytesReader(content)
|
|
181
|
-
else:
|
|
182
|
-
content_length = 2
|
|
183
|
-
body = SeekableAsyncBytesReader(b"{}")
|
|
174
|
+
codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
|
|
175
|
+
content = codec.serialize(input)
|
|
176
|
+
if not content:
|
|
177
|
+
content = b"{}"
|
|
178
|
+
content_length = len(content)
|
|
179
|
+
body = SeekableAsyncBytesReader(content)
|
|
184
180
|
|
|
185
181
|
headers = Fields(
|
|
186
182
|
[
|
|
@@ -254,12 +250,16 @@ async def _serialize_create_context(input: CreateContextInput, config: Config) -
|
|
|
254
250
|
query: str = f''
|
|
255
251
|
|
|
256
252
|
body: AsyncIterable[bytes] = AsyncBytesReader(b'')
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
content =
|
|
261
|
-
|
|
262
|
-
|
|
253
|
+
content_length: int = 0
|
|
254
|
+
if input.request is not None:
|
|
255
|
+
codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
|
|
256
|
+
content = codec.serialize(input.request)
|
|
257
|
+
|
|
258
|
+
content_length = len(content)
|
|
259
|
+
body = SeekableAsyncBytesReader(content)
|
|
260
|
+
else:
|
|
261
|
+
content_length = 2
|
|
262
|
+
body = SeekableAsyncBytesReader(b"{}")
|
|
263
263
|
|
|
264
264
|
headers = Fields(
|
|
265
265
|
[
|
|
@@ -878,7 +878,7 @@ async def _serialize_get_config(input: GetConfigInput, config: Config) -> HTTPRe
|
|
|
878
878
|
|
|
879
879
|
query_params: list[tuple[str, str | None]] = []
|
|
880
880
|
if input.prefix is not None:
|
|
881
|
-
query_params.
|
|
881
|
+
query_params.extend(("prefix", e) for e in input.prefix)
|
|
882
882
|
if input.version is not None:
|
|
883
883
|
query_params.append(("version", input.version))
|
|
884
884
|
|
|
@@ -1205,7 +1205,7 @@ async def _serialize_get_resolved_config(input: GetResolvedConfigInput, config:
|
|
|
1205
1205
|
|
|
1206
1206
|
query_params: list[tuple[str, str | None]] = []
|
|
1207
1207
|
if input.prefix is not None:
|
|
1208
|
-
query_params.
|
|
1208
|
+
query_params.extend(("prefix", e) for e in input.prefix)
|
|
1209
1209
|
if input.version is not None:
|
|
1210
1210
|
query_params.append(("version", input.version))
|
|
1211
1211
|
if input.show_reasoning is not None:
|
|
@@ -1460,9 +1460,9 @@ async def _serialize_list_audit_logs(input: ListAuditLogsInput, config: Config)
|
|
|
1460
1460
|
if input.to_date is not None:
|
|
1461
1461
|
query_params.append(("to_date", serialize_rfc3339(ensure_utc(input.to_date))))
|
|
1462
1462
|
if input.tables is not None:
|
|
1463
|
-
query_params.
|
|
1463
|
+
query_params.extend(("table", e) for e in input.tables)
|
|
1464
1464
|
if input.action is not None:
|
|
1465
|
-
query_params.
|
|
1465
|
+
query_params.extend(("action", e) for e in input.action)
|
|
1466
1466
|
if input.username is not None:
|
|
1467
1467
|
query_params.append(("username", input.username))
|
|
1468
1468
|
if input.sort_by is not None:
|
|
@@ -1505,15 +1505,15 @@ async def _serialize_list_contexts(input: ListContextsInput, config: Config) ->
|
|
|
1505
1505
|
if input.all is not None:
|
|
1506
1506
|
query_params.append(("all", ('true' if input.all else 'false')))
|
|
1507
1507
|
if input.prefix is not None:
|
|
1508
|
-
query_params.
|
|
1508
|
+
query_params.extend(("prefix", e) for e in input.prefix)
|
|
1509
1509
|
if input.sort_on is not None:
|
|
1510
1510
|
query_params.append(("sort_on", input.sort_on))
|
|
1511
1511
|
if input.sort_by is not None:
|
|
1512
1512
|
query_params.append(("sort_by", input.sort_by))
|
|
1513
1513
|
if input.created_by is not None:
|
|
1514
|
-
query_params.
|
|
1514
|
+
query_params.extend(("created_by", e) for e in input.created_by)
|
|
1515
1515
|
if input.last_modified_by is not None:
|
|
1516
|
-
query_params.
|
|
1516
|
+
query_params.extend(("last_modified_by", e) for e in input.last_modified_by)
|
|
1517
1517
|
if input.plaintext is not None:
|
|
1518
1518
|
query_params.append(("plaintext", input.plaintext))
|
|
1519
1519
|
if input.dimension_match_strategy is not None:
|
|
@@ -1632,7 +1632,7 @@ async def _serialize_list_experiment(input: ListExperimentInput, config: Config)
|
|
|
1632
1632
|
if input.all is not None:
|
|
1633
1633
|
query_params.append(("all", ('true' if input.all else 'false')))
|
|
1634
1634
|
if input.status is not None:
|
|
1635
|
-
query_params.
|
|
1635
|
+
query_params.extend(("status", e) for e in input.status)
|
|
1636
1636
|
if input.from_date is not None:
|
|
1637
1637
|
query_params.append(("from_date", serialize_rfc3339(ensure_utc(input.from_date))))
|
|
1638
1638
|
if input.to_date is not None:
|
|
@@ -1640,11 +1640,11 @@ async def _serialize_list_experiment(input: ListExperimentInput, config: Config)
|
|
|
1640
1640
|
if input.experiment_name is not None:
|
|
1641
1641
|
query_params.append(("experiment_name", input.experiment_name))
|
|
1642
1642
|
if input.experiment_ids is not None:
|
|
1643
|
-
query_params.
|
|
1643
|
+
query_params.extend(("experiment_ids", e) for e in input.experiment_ids)
|
|
1644
1644
|
if input.experiment_group_ids is not None:
|
|
1645
|
-
query_params.
|
|
1645
|
+
query_params.extend(("experiment_group_ids", e) for e in input.experiment_group_ids)
|
|
1646
1646
|
if input.created_by is not None:
|
|
1647
|
-
query_params.
|
|
1647
|
+
query_params.extend(("created_by", e) for e in input.created_by)
|
|
1648
1648
|
if input.sort_on is not None:
|
|
1649
1649
|
query_params.append(("sort_on", input.sort_on))
|
|
1650
1650
|
if input.sort_by is not None:
|
|
@@ -1701,7 +1701,7 @@ async def _serialize_list_experiment_groups(input: ListExperimentGroupsInput, co
|
|
|
1701
1701
|
if input.sort_by is not None:
|
|
1702
1702
|
query_params.append(("sort_by", input.sort_by))
|
|
1703
1703
|
if input.group_type is not None:
|
|
1704
|
-
query_params.
|
|
1704
|
+
query_params.extend(("group_type", e) for e in input.group_type)
|
|
1705
1705
|
|
|
1706
1706
|
query = join_query_params(params=query_params, prefix=query)
|
|
1707
1707
|
|
|
@@ -1739,6 +1739,8 @@ async def _serialize_list_function(input: ListFunctionInput, config: Config) ->
|
|
|
1739
1739
|
query_params.append(("page", str(input.page)))
|
|
1740
1740
|
if input.all is not None:
|
|
1741
1741
|
query_params.append(("all", ('true' if input.all else 'false')))
|
|
1742
|
+
if input.function_type is not None:
|
|
1743
|
+
query_params.extend(("function_type", e) for e in input.function_type)
|
|
1742
1744
|
|
|
1743
1745
|
query = join_query_params(params=query_params, prefix=query)
|
|
1744
1746
|
|
|
@@ -1945,12 +1947,16 @@ async def _serialize_move_context(input: MoveContextInput, config: Config) -> HT
|
|
|
1945
1947
|
query: str = f''
|
|
1946
1948
|
|
|
1947
1949
|
body: AsyncIterable[bytes] = AsyncBytesReader(b'')
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
content =
|
|
1952
|
-
|
|
1953
|
-
|
|
1950
|
+
content_length: int = 0
|
|
1951
|
+
if input.request is not None:
|
|
1952
|
+
codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
|
|
1953
|
+
content = codec.serialize(input.request)
|
|
1954
|
+
|
|
1955
|
+
content_length = len(content)
|
|
1956
|
+
body = SeekableAsyncBytesReader(content)
|
|
1957
|
+
else:
|
|
1958
|
+
content_length = 2
|
|
1959
|
+
body = SeekableAsyncBytesReader(b"{}")
|
|
1954
1960
|
|
|
1955
1961
|
headers = Fields(
|
|
1956
1962
|
[
|
|
@@ -2464,7 +2470,7 @@ async def _serialize_update_override(input: UpdateOverrideInput, config: Config)
|
|
|
2464
2470
|
scheme="https",
|
|
2465
2471
|
query=query,
|
|
2466
2472
|
),
|
|
2467
|
-
method="
|
|
2473
|
+
method="PATCH",
|
|
2468
2474
|
fields=headers,
|
|
2469
2475
|
body=body,
|
|
2470
2476
|
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: superposition_sdk
|
|
3
|
+
Version: 0.93.1
|
|
4
|
+
Summary: superposition_sdk client
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Keywords: smithy,superposition_sdk
|
|
7
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Intended Audience :: System Administrators
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Requires-Dist: smithy-core==0.0.1
|
|
19
|
+
Requires-Dist: smithy-http[aiohttp]==0.0.1
|
|
20
|
+
Requires-Dist: smithy-json==0.0.1
|
|
21
|
+
Provides-Extra: docs
|
|
22
|
+
Requires-Dist: pydata-sphinx-theme>=0.16.1; extra == 'docs'
|
|
23
|
+
Requires-Dist: sphinx>=8.2.3; extra == 'docs'
|
|
24
|
+
Provides-Extra: tests
|
|
25
|
+
Requires-Dist: pytest-asyncio<0.21.0,>=0.20.3; extra == 'tests'
|
|
26
|
+
Requires-Dist: pytest<8.0.0,>=7.2.0; extra == 'tests'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# Superposition SDK
|
|
30
|
+
|
|
31
|
+
Superposition SDK is a Python client for the Superposition platform, designed to facilitate programmatic integration of all Superposition's API capabilities in Python applications. Read the complete documentation at [Superposition SDK Documentation](https://juspay.io/superposition/docs).
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
Install the Superposition SDK using pip:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install superposition-sdk
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Initialization
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from superposition_sdk.client import Config, Superposition
|
|
45
|
+
client = Superposition(Config(endpoint_uri="http://localhost:8080"))
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
The SDK provides commands for every API call that Superposition supports. Below is an example of how to use the SDK to list default configs.
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import asyncio
|
|
54
|
+
from superposition_sdk.client import Config, ListDefaultConfigsInput, Superposition
|
|
55
|
+
from pprint import pprint
|
|
56
|
+
|
|
57
|
+
async def list_configs():
|
|
58
|
+
client = Superposition(Config(endpoint_uri="http://localhost:8080"))
|
|
59
|
+
list_configs = ListDefaultConfigsInput(workspace_id="upi", org_id="orgid162145664241766405", all=True)
|
|
60
|
+
response = await client.list_default_configs(list_configs)
|
|
61
|
+
pprint(response)
|
|
62
|
+
|
|
63
|
+
asyncio.run(list_configs())
|
|
64
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
superposition_sdk/__init__.py,sha256=Inc_oe2U1CzZ_ZxsNVbU96RGaAlD-6M5xt1ZcW5hGUo,83
|
|
2
|
+
superposition_sdk/auth.py,sha256=U9D3FmOH8TX0cjibGy_CRnAkTnFEavAek0Jw1YUhN2g,404
|
|
3
|
+
superposition_sdk/client.py,sha256=rs7o9mTBQ7az1PdEK_FfLwyNKvP0vJrFoO3esBZOEbk,102350
|
|
4
|
+
superposition_sdk/config.py,sha256=9sPXQhX31OzU2nnOFrzlchFpfHpgnltWXynZY6qwweo,12244
|
|
5
|
+
superposition_sdk/deserialize.py,sha256=b-qT2scth-4xczdQl0LDGC7CvEi450zbvYFn5HKBF8U,85255
|
|
6
|
+
superposition_sdk/models.py,sha256=P7eVbBm0s5D_MhlizoOBnOfKtFbaZi6RqOf-ylxNKYE,596841
|
|
7
|
+
superposition_sdk/serialize.py,sha256=r23J6Y1zOAekiDTBEIouiDWyy1l-phE0LKsL_bRNZb8,80235
|
|
8
|
+
superposition_sdk/_private/__init__.py,sha256=DxsJq42a0KfQv9zzLrqT0JVpoXrR-IDIYFGuJe4g1Gc,55
|
|
9
|
+
superposition_sdk/_private/schemas.py,sha256=HsBroo2-j00ChQ5J0bC2RP8rkdTeQnC55Si0vhXQRTY,340724
|
|
10
|
+
superposition_sdk-0.93.1.dist-info/METADATA,sha256=N1Et9aa1fOf_leyCtUd-J7xjlyk5s9sxVXma1sMCBTc,2278
|
|
11
|
+
superposition_sdk-0.93.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
12
|
+
superposition_sdk-0.93.1.dist-info/RECORD,,
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: superposition_sdk
|
|
3
|
-
Version: 0.92.0
|
|
4
|
-
Summary: superposition_sdk client
|
|
5
|
-
License: Apache-2.0
|
|
6
|
-
Keywords: smithy,superposition_sdk
|
|
7
|
-
Classifier: Development Status :: 2 - Pre-Alpha
|
|
8
|
-
Classifier: Intended Audience :: Developers
|
|
9
|
-
Classifier: Intended Audience :: System Administrators
|
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
-
Classifier: Natural Language :: English
|
|
12
|
-
Classifier: Programming Language :: Python
|
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
Requires-Python: >=3.12
|
|
18
|
-
Requires-Dist: smithy-core==0.0.1
|
|
19
|
-
Requires-Dist: smithy-http[aiohttp]==0.0.1
|
|
20
|
-
Requires-Dist: smithy-json==0.0.1
|
|
21
|
-
Provides-Extra: docs
|
|
22
|
-
Requires-Dist: pydata-sphinx-theme>=0.16.1; extra == 'docs'
|
|
23
|
-
Requires-Dist: sphinx>=8.2.3; extra == 'docs'
|
|
24
|
-
Provides-Extra: tests
|
|
25
|
-
Requires-Dist: pytest-asyncio<0.21.0,>=0.20.3; extra == 'tests'
|
|
26
|
-
Requires-Dist: pytest<8.0.0,>=7.2.0; extra == 'tests'
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
|
|
29
|
-
## Superposition Client
|
|
30
|
-
|
|
31
|
-
superposition_sdk client
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
superposition_sdk/__init__.py,sha256=Inc_oe2U1CzZ_ZxsNVbU96RGaAlD-6M5xt1ZcW5hGUo,83
|
|
2
|
-
superposition_sdk/auth.py,sha256=U9D3FmOH8TX0cjibGy_CRnAkTnFEavAek0Jw1YUhN2g,404
|
|
3
|
-
superposition_sdk/client.py,sha256=rs7o9mTBQ7az1PdEK_FfLwyNKvP0vJrFoO3esBZOEbk,102350
|
|
4
|
-
superposition_sdk/config.py,sha256=9sPXQhX31OzU2nnOFrzlchFpfHpgnltWXynZY6qwweo,12244
|
|
5
|
-
superposition_sdk/deserialize.py,sha256=QZRjEs6oTCaGHf91_Dux-MNRLUNJohVfzOIhqgSTI-I,85196
|
|
6
|
-
superposition_sdk/models.py,sha256=ladrZWapBmukrBxiDryuPaTgTajPiUIomKWqhvlfrmE,603203
|
|
7
|
-
superposition_sdk/serialize.py,sha256=3pHJl1YY3uP3wAulnZfCpxcw4nxeByw9CGlic9M3LJk,79869
|
|
8
|
-
superposition_sdk/_private/__init__.py,sha256=DxsJq42a0KfQv9zzLrqT0JVpoXrR-IDIYFGuJe4g1Gc,55
|
|
9
|
-
superposition_sdk/_private/schemas.py,sha256=dPYj-p49VD0syJzIAbrBk3FO_M3_ehbiYiODNfiBbrE,326398
|
|
10
|
-
superposition_sdk-0.92.0.dist-info/METADATA,sha256=yG7UKQ-Di9YBEBDY0yWqMrqnThjLw5-1zE9QzZAeyY4,1143
|
|
11
|
-
superposition_sdk-0.92.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
12
|
-
superposition_sdk-0.92.0.dist-info/RECORD,,
|
|
File without changes
|