Skip to content

Commit bbbaf78

Browse files
authored
Merge pull request #1 from tuneinsight/diapason-v0.9
Diapason release v0.9
2 parents abb3754 + 33daed4 commit bbbaf78

File tree

191 files changed

+13097
-5870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+13097
-5870
lines changed

PKG-INFO

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: tuneinsight
3-
Version: 0.6.2
3+
Version: 0.9.0
44
Summary: Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0.
55
License: Apache-2.0
66
Author: Tune Insight SA
@@ -13,15 +13,16 @@ Classifier: Programming Language :: Python :: 3.10
1313
Classifier: Programming Language :: Python :: 3.11
1414
Requires-Dist: PyYAML (>=6.0,<7.0)
1515
Requires-Dist: attrs (>=21.3.0)
16-
Requires-Dist: black (>=24.1.0,<25.0.0)
16+
Requires-Dist: black (==24.2.0)
1717
Requires-Dist: certifi (>=2023.7.22,<2024.0.0)
18+
Requires-Dist: handsdown (>=2.1.0,<3.0.0)
1819
Requires-Dist: httpx (>=0.15.4,<0.24.0)
1920
Requires-Dist: matplotlib (>=3.5.0,<4.0.0)
2021
Requires-Dist: notebook (>=6.4.11,<7.0.0)
2122
Requires-Dist: pandas (>=1.3.5,<2.0.0)
2223
Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
2324
Requires-Dist: python-dotenv (>=0.21.0,<0.22.0)
24-
Requires-Dist: python-keycloak (>=0.27.0,<0.28.0)
25+
Requires-Dist: python-keycloak (>=3.9.0,<4.0.0)
2526
Requires-Dist: typing-extensions (>=4.6.3,<5.0.0)
2627
Description-Content-Type: text/markdown
2728

pyproject.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
[tool.poetry]
22
name = "tuneinsight"
3-
version = "0.6.2"
3+
version = "0.9.0"
44
description = "Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0."
55
authors = ["Tune Insight SA"]
66
license = "Apache-2.0"
77
include = [
88
"src/tuneinsight/api/**/*.py",
9+
"src/tuneinsight/api/api-checksum",
910
"src/tuneinsight/cryptolib/*.so",
1011
"src/tuneinsight/cryptolib/*.dll"
1112
]
1213
readme = "src/tuneinsight/README.md"
1314

1415
[tool.poetry.dependencies]
1516
python = ">= 3.8,<3.12"
16-
python-keycloak = "^0.27.0"
17+
python-keycloak = "^3.9.0"
1718
pandas = "^1.3.5"
1819
PyYAML = "^6.0"
1920
notebook = "^6.4.11"
@@ -26,7 +27,8 @@ typing-extensions = "^4.6.3"
2627
httpx = ">=0.15.4,<0.24.0"
2728
attrs = ">=21.3.0"
2829
certifi = "^2023.7.22"
29-
black = "^24.1.0"
30+
black = "24.2.0"
31+
handsdown = "^2.1.0"
3032

3133
[tool.poetry.group.dev.dependencies]
3234
selenium = "^4.9.1"

src/tuneinsight/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Tune Insight Diapason SDK."""
2+
3+
# Import the key class.
4+
from .client import Diapason
5+
6+
# Also import the API models, as they tend to be useful.
7+
from .api.sdk import models

src/tuneinsight/api/api-checksum

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b71c951f2eb600cc2a1f073151c9a0c003bd48f1210262ab7df58c9d06e05aba

src/tuneinsight/api/sdk/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" A client library for accessing Tune Insight API """
2+
23
from .client import AuthenticatedClient, Client
34

45
__all__ = (

src/tuneinsight/api/sdk/api/api_datagen/post_mock_dataset.py

+44-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from http import HTTPStatus
2-
from typing import Any, Dict, Optional, Union
2+
from typing import Any, Dict, Optional, Union, cast
33

44
import httpx
55

@@ -19,6 +19,8 @@ def _get_kwargs(
1919
name: Union[Unset, None, str] = UNSET,
2020
numrows: int,
2121
seed: Union[Unset, None, str] = UNSET,
22+
create_datasource: Union[Unset, None, bool] = UNSET,
23+
clear_if_exists: Union[Unset, None, bool] = UNSET,
2224
) -> Dict[str, Any]:
2325
url = "{}/mock/dataset".format(client.base_url)
2426

@@ -36,6 +38,10 @@ def _get_kwargs(
3638

3739
params["seed"] = seed
3840

41+
params["createDatasource"] = create_datasource
42+
43+
params["clearIfExists"] = clear_if_exists
44+
3945
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
4046

4147
json_json_body = json_body
@@ -51,7 +57,10 @@ def _get_kwargs(
5157
}
5258

5359

54-
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[DataSource, Error]]:
60+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, DataSource, Error]]:
61+
if response.status_code == HTTPStatus.OK:
62+
response_200 = cast(Any, None)
63+
return response_200
5564
if response.status_code == HTTPStatus.CREATED:
5665
response_201 = DataSource.from_dict(response.json())
5766

@@ -74,7 +83,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
7483
return None
7584

7685

77-
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[DataSource, Error]]:
86+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, DataSource, Error]]:
7887
return Response(
7988
status_code=HTTPStatus(response.status_code),
8089
content=response.content,
@@ -91,22 +100,26 @@ def sync_detailed(
91100
name: Union[Unset, None, str] = UNSET,
92101
numrows: int,
93102
seed: Union[Unset, None, str] = UNSET,
94-
) -> Response[Union[DataSource, Error]]:
103+
create_datasource: Union[Unset, None, bool] = UNSET,
104+
clear_if_exists: Union[Unset, None, bool] = UNSET,
105+
) -> Response[Union[Any, DataSource, Error]]:
95106
"""Request the creation of a mock dataset.
96107
97108
Args:
98109
method (PostMockDatasetMethod):
99110
name (Union[Unset, None, str]):
100111
numrows (int):
101112
seed (Union[Unset, None, str]):
113+
create_datasource (Union[Unset, None, bool]):
114+
clear_if_exists (Union[Unset, None, bool]):
102115
json_body (str):
103116
104117
Raises:
105118
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
106119
httpx.TimeoutException: If the request takes longer than Client.timeout.
107120
108121
Returns:
109-
Response[Union[DataSource, Error]]
122+
Response[Union[Any, DataSource, Error]]
110123
"""
111124

112125
kwargs = _get_kwargs(
@@ -116,6 +129,8 @@ def sync_detailed(
116129
name=name,
117130
numrows=numrows,
118131
seed=seed,
132+
create_datasource=create_datasource,
133+
clear_if_exists=clear_if_exists,
119134
)
120135

121136
response = httpx.request(
@@ -134,22 +149,26 @@ def sync(
134149
name: Union[Unset, None, str] = UNSET,
135150
numrows: int,
136151
seed: Union[Unset, None, str] = UNSET,
137-
) -> Optional[Union[DataSource, Error]]:
152+
create_datasource: Union[Unset, None, bool] = UNSET,
153+
clear_if_exists: Union[Unset, None, bool] = UNSET,
154+
) -> Optional[Union[Any, DataSource, Error]]:
138155
"""Request the creation of a mock dataset.
139156
140157
Args:
141158
method (PostMockDatasetMethod):
142159
name (Union[Unset, None, str]):
143160
numrows (int):
144161
seed (Union[Unset, None, str]):
162+
create_datasource (Union[Unset, None, bool]):
163+
clear_if_exists (Union[Unset, None, bool]):
145164
json_body (str):
146165
147166
Raises:
148167
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
149168
httpx.TimeoutException: If the request takes longer than Client.timeout.
150169
151170
Returns:
152-
Response[Union[DataSource, Error]]
171+
Response[Union[Any, DataSource, Error]]
153172
"""
154173

155174
return sync_detailed(
@@ -159,6 +178,8 @@ def sync(
159178
name=name,
160179
numrows=numrows,
161180
seed=seed,
181+
create_datasource=create_datasource,
182+
clear_if_exists=clear_if_exists,
162183
).parsed
163184

164185

@@ -170,22 +191,26 @@ async def asyncio_detailed(
170191
name: Union[Unset, None, str] = UNSET,
171192
numrows: int,
172193
seed: Union[Unset, None, str] = UNSET,
173-
) -> Response[Union[DataSource, Error]]:
194+
create_datasource: Union[Unset, None, bool] = UNSET,
195+
clear_if_exists: Union[Unset, None, bool] = UNSET,
196+
) -> Response[Union[Any, DataSource, Error]]:
174197
"""Request the creation of a mock dataset.
175198
176199
Args:
177200
method (PostMockDatasetMethod):
178201
name (Union[Unset, None, str]):
179202
numrows (int):
180203
seed (Union[Unset, None, str]):
204+
create_datasource (Union[Unset, None, bool]):
205+
clear_if_exists (Union[Unset, None, bool]):
181206
json_body (str):
182207
183208
Raises:
184209
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
185210
httpx.TimeoutException: If the request takes longer than Client.timeout.
186211
187212
Returns:
188-
Response[Union[DataSource, Error]]
213+
Response[Union[Any, DataSource, Error]]
189214
"""
190215

191216
kwargs = _get_kwargs(
@@ -195,6 +220,8 @@ async def asyncio_detailed(
195220
name=name,
196221
numrows=numrows,
197222
seed=seed,
223+
create_datasource=create_datasource,
224+
clear_if_exists=clear_if_exists,
198225
)
199226

200227
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
@@ -211,22 +238,26 @@ async def asyncio(
211238
name: Union[Unset, None, str] = UNSET,
212239
numrows: int,
213240
seed: Union[Unset, None, str] = UNSET,
214-
) -> Optional[Union[DataSource, Error]]:
241+
create_datasource: Union[Unset, None, bool] = UNSET,
242+
clear_if_exists: Union[Unset, None, bool] = UNSET,
243+
) -> Optional[Union[Any, DataSource, Error]]:
215244
"""Request the creation of a mock dataset.
216245
217246
Args:
218247
method (PostMockDatasetMethod):
219248
name (Union[Unset, None, str]):
220249
numrows (int):
221250
seed (Union[Unset, None, str]):
251+
create_datasource (Union[Unset, None, bool]):
252+
clear_if_exists (Union[Unset, None, bool]):
222253
json_body (str):
223254
224255
Raises:
225256
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
226257
httpx.TimeoutException: If the request takes longer than Client.timeout.
227258
228259
Returns:
229-
Response[Union[DataSource, Error]]
260+
Response[Union[Any, DataSource, Error]]
230261
"""
231262

232263
return (
@@ -237,5 +268,7 @@ async def asyncio(
237268
name=name,
238269
numrows=numrows,
239270
seed=seed,
271+
create_datasource=create_datasource,
272+
clear_if_exists=clear_if_exists,
240273
)
241274
).parsed

0 commit comments

Comments
 (0)