Skip to content

Commit

Permalink
Merge pull request #1 from tuneinsight/diapason-v0.9
Browse files Browse the repository at this point in the history
Diapason release v0.9
  • Loading branch information
fhoussiau authored Mar 19, 2024
2 parents abb3754 + 33daed4 commit bbbaf78
Show file tree
Hide file tree
Showing 191 changed files with 13,097 additions and 5,870 deletions.
7 changes: 4 additions & 3 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tuneinsight
Version: 0.6.2
Version: 0.9.0
Summary: Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0.
License: Apache-2.0
Author: Tune Insight SA
Expand All @@ -13,15 +13,16 @@ Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: PyYAML (>=6.0,<7.0)
Requires-Dist: attrs (>=21.3.0)
Requires-Dist: black (>=24.1.0,<25.0.0)
Requires-Dist: black (==24.2.0)
Requires-Dist: certifi (>=2023.7.22,<2024.0.0)
Requires-Dist: handsdown (>=2.1.0,<3.0.0)
Requires-Dist: httpx (>=0.15.4,<0.24.0)
Requires-Dist: matplotlib (>=3.5.0,<4.0.0)
Requires-Dist: notebook (>=6.4.11,<7.0.0)
Requires-Dist: pandas (>=1.3.5,<2.0.0)
Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
Requires-Dist: python-dotenv (>=0.21.0,<0.22.0)
Requires-Dist: python-keycloak (>=0.27.0,<0.28.0)
Requires-Dist: python-keycloak (>=3.9.0,<4.0.0)
Requires-Dist: typing-extensions (>=4.6.3,<5.0.0)
Description-Content-Type: text/markdown

Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[tool.poetry]
name = "tuneinsight"
version = "0.6.2"
version = "0.9.0"
description = "Diapason is the official Python SDK for the Tune Insight API. Version 0.6.2 targets the API v0.8.0."
authors = ["Tune Insight SA"]
license = "Apache-2.0"
include = [
"src/tuneinsight/api/**/*.py",
"src/tuneinsight/api/api-checksum",
"src/tuneinsight/cryptolib/*.so",
"src/tuneinsight/cryptolib/*.dll"
]
readme = "src/tuneinsight/README.md"

[tool.poetry.dependencies]
python = ">= 3.8,<3.12"
python-keycloak = "^0.27.0"
python-keycloak = "^3.9.0"
pandas = "^1.3.5"
PyYAML = "^6.0"
notebook = "^6.4.11"
Expand All @@ -26,7 +27,8 @@ typing-extensions = "^4.6.3"
httpx = ">=0.15.4,<0.24.0"
attrs = ">=21.3.0"
certifi = "^2023.7.22"
black = "^24.1.0"
black = "24.2.0"
handsdown = "^2.1.0"

[tool.poetry.group.dev.dependencies]
selenium = "^4.9.1"
Expand Down
7 changes: 7 additions & 0 deletions src/tuneinsight/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Tune Insight Diapason SDK."""

# Import the key class.
from .client import Diapason

# Also import the API models, as they tend to be useful.
from .api.sdk import models
1 change: 1 addition & 0 deletions src/tuneinsight/api/api-checksum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b71c951f2eb600cc2a1f073151c9a0c003bd48f1210262ab7df58c9d06e05aba
1 change: 1 addition & 0 deletions src/tuneinsight/api/sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" A client library for accessing Tune Insight API """

from .client import AuthenticatedClient, Client

__all__ = (
Expand Down
55 changes: 44 additions & 11 deletions src/tuneinsight/api/sdk/api/api_datagen/post_mock_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Dict, Optional, Union
from typing import Any, Dict, Optional, Union, cast

import httpx

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

Expand All @@ -36,6 +38,10 @@ def _get_kwargs(

params["seed"] = seed

params["createDatasource"] = create_datasource

params["clearIfExists"] = clear_if_exists

params = {k: v for k, v in params.items() if v is not UNSET and v is not None}

json_json_body = json_body
Expand All @@ -51,7 +57,10 @@ def _get_kwargs(
}


def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[DataSource, Error]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, DataSource, Error]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(Any, None)
return response_200
if response.status_code == HTTPStatus.CREATED:
response_201 = DataSource.from_dict(response.json())

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


def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[DataSource, Error]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, DataSource, Error]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -91,22 +100,26 @@ def sync_detailed(
name: Union[Unset, None, str] = UNSET,
numrows: int,
seed: Union[Unset, None, str] = UNSET,
) -> Response[Union[DataSource, Error]]:
create_datasource: Union[Unset, None, bool] = UNSET,
clear_if_exists: Union[Unset, None, bool] = UNSET,
) -> Response[Union[Any, DataSource, Error]]:
"""Request the creation of a mock dataset.
Args:
method (PostMockDatasetMethod):
name (Union[Unset, None, str]):
numrows (int):
seed (Union[Unset, None, str]):
create_datasource (Union[Unset, None, bool]):
clear_if_exists (Union[Unset, None, bool]):
json_body (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[DataSource, Error]]
Response[Union[Any, DataSource, Error]]
"""

kwargs = _get_kwargs(
Expand All @@ -116,6 +129,8 @@ def sync_detailed(
name=name,
numrows=numrows,
seed=seed,
create_datasource=create_datasource,
clear_if_exists=clear_if_exists,
)

response = httpx.request(
Expand All @@ -134,22 +149,26 @@ def sync(
name: Union[Unset, None, str] = UNSET,
numrows: int,
seed: Union[Unset, None, str] = UNSET,
) -> Optional[Union[DataSource, Error]]:
create_datasource: Union[Unset, None, bool] = UNSET,
clear_if_exists: Union[Unset, None, bool] = UNSET,
) -> Optional[Union[Any, DataSource, Error]]:
"""Request the creation of a mock dataset.
Args:
method (PostMockDatasetMethod):
name (Union[Unset, None, str]):
numrows (int):
seed (Union[Unset, None, str]):
create_datasource (Union[Unset, None, bool]):
clear_if_exists (Union[Unset, None, bool]):
json_body (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[DataSource, Error]]
Response[Union[Any, DataSource, Error]]
"""

return sync_detailed(
Expand All @@ -159,6 +178,8 @@ def sync(
name=name,
numrows=numrows,
seed=seed,
create_datasource=create_datasource,
clear_if_exists=clear_if_exists,
).parsed


Expand All @@ -170,22 +191,26 @@ async def asyncio_detailed(
name: Union[Unset, None, str] = UNSET,
numrows: int,
seed: Union[Unset, None, str] = UNSET,
) -> Response[Union[DataSource, Error]]:
create_datasource: Union[Unset, None, bool] = UNSET,
clear_if_exists: Union[Unset, None, bool] = UNSET,
) -> Response[Union[Any, DataSource, Error]]:
"""Request the creation of a mock dataset.
Args:
method (PostMockDatasetMethod):
name (Union[Unset, None, str]):
numrows (int):
seed (Union[Unset, None, str]):
create_datasource (Union[Unset, None, bool]):
clear_if_exists (Union[Unset, None, bool]):
json_body (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[DataSource, Error]]
Response[Union[Any, DataSource, Error]]
"""

kwargs = _get_kwargs(
Expand All @@ -195,6 +220,8 @@ async def asyncio_detailed(
name=name,
numrows=numrows,
seed=seed,
create_datasource=create_datasource,
clear_if_exists=clear_if_exists,
)

async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
Expand All @@ -211,22 +238,26 @@ async def asyncio(
name: Union[Unset, None, str] = UNSET,
numrows: int,
seed: Union[Unset, None, str] = UNSET,
) -> Optional[Union[DataSource, Error]]:
create_datasource: Union[Unset, None, bool] = UNSET,
clear_if_exists: Union[Unset, None, bool] = UNSET,
) -> Optional[Union[Any, DataSource, Error]]:
"""Request the creation of a mock dataset.
Args:
method (PostMockDatasetMethod):
name (Union[Unset, None, str]):
numrows (int):
seed (Union[Unset, None, str]):
create_datasource (Union[Unset, None, bool]):
clear_if_exists (Union[Unset, None, bool]):
json_body (str):
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Response[Union[DataSource, Error]]
Response[Union[Any, DataSource, Error]]
"""

return (
Expand All @@ -237,5 +268,7 @@ async def asyncio(
name=name,
numrows=numrows,
seed=seed,
create_datasource=create_datasource,
clear_if_exists=clear_if_exists,
)
).parsed
Loading

0 comments on commit bbbaf78

Please sign in to comment.