Skip to content

Commit 9d585bd

Browse files
authored
Merge pull request #13 from tuneinsight/release-v1.1.0
v1.1.0 release
2 parents 0ca2b81 + 90f094e commit 9d585bd

Some content is hidden

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

59 files changed

+1716
-221
lines changed

PKG-INFO

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
Metadata-Version: 2.1
22
Name: tuneinsight
3-
Version: 1.0.1
3+
Version: 1.1.0
44
Summary: Official Python SDK for the Tune Insight API. The current version is compatible with the same version of the API.
55
License: Apache-2.0
66
Author: Tune Insight SA
7-
Requires-Python: >=3.9,<4.0
7+
Requires-Python: >=3.9, !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*, !=3.8.*
88
Classifier: License :: OSI Approved :: Apache Software License
99
Classifier: Programming Language :: Python :: 3
10-
Classifier: Programming Language :: Python :: 3.9
1110
Classifier: Programming Language :: Python :: 3.10
1211
Classifier: Programming Language :: Python :: 3.11
1312
Classifier: Programming Language :: Python :: 3.12
1413
Requires-Dist: PyYAML (>=6.0,<7.0)
1514
Requires-Dist: attrs (>=21.3.0)
1615
Requires-Dist: black (==24.2.0)
1716
Requires-Dist: certifi (>=2024.07.04,<2025.0.0)
17+
Requires-Dist: cryptography (>=44.0.1,<45.0.0)
18+
Requires-Dist: h11 (>=0.16.0,<0.17.0)
1819
Requires-Dist: httpx (>=0.15.4,<0.28.0)
20+
Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
1921
Requires-Dist: jupyter (>=1.1.1,<2.0.0)
2022
Requires-Dist: jupyterlab (==4.2.5)
2123
Requires-Dist: matplotlib (>=3.5.0,<4.0.0)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pip freeze | grep tuneinsight
7474
The result should look like this:
7575

7676
```
77-
tuneinsight==1.0.1
77+
tuneinsight==1.1.0
7878
```
7979

8080
If you see a line that looks like this,
@@ -85,7 +85,7 @@ tuneinsight @ file:///path/to/file/tuneinsight-0.13.1-py3-none-any.whl#sha256=..
8585

8686
the SDK was installed directly from a `.whl` file, suggesting you are using an older version. You might need to install a more recent version, using `pip`:
8787

88-
`pip install tuneinsight==1.0.1`
88+
`pip install tuneinsight==1.1.0`
8989

9090
#### Error: Could not load the cryptolib: contact your administrator.
9191

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "tuneinsight"
3-
version = "1.0.1"
3+
version = "1.1.0"
44
description = "Official Python SDK for the Tune Insight API. The current version is compatible with the same version of the API."
55
authors = ["Tune Insight SA"]
66
license = "Apache-2.0"
@@ -20,14 +20,17 @@ pattern = "^v(?P<base>\\d+\\.\\d+\\.\\d+)"
2020
format = "{base}"
2121

2222
[tool.poetry.dependencies]
23-
python = ">= 3.9,<4.0"
23+
python = ">3.9.0,<3.9.1 || >3.9.1,<4.0"
2424
python-keycloak = "^3.9.0"
2525
PyYAML = "^6.0"
2626
notebook = "^6.4.11"
2727
python-dotenv = "^0.21.0"
2828
python-dateutil = "^2.8.0"
2929
matplotlib = "^3.5.0"
3030
typing-extensions = "^4.6.3"
31+
h11 = "^0.16.0"
32+
jinja2 = "^3.1.6"
33+
cryptography = "^44.0.1"
3134

3235
# Required by ge_co_rest_api
3336
httpx = ">=0.15.4,<0.28.0"

src/tuneinsight/api/api-checksum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0d5fa5e5c06de59a4c29dc6aa5cf12011640e12055eafcc55c58ac91f5428782
1+
b023866fb4734796dcf385bd51e14abd8711a989ad73876a1fee8b49e2f3c775
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
from http import HTTPStatus
2+
from typing import Any, Dict, Optional, Union, cast
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import Client
8+
from ...models.error import Error
9+
from ...types import Response
10+
11+
12+
def _get_kwargs(
13+
*,
14+
client: Client,
15+
) -> Dict[str, Any]:
16+
url = "{}/build-global-catalog".format(client.base_url)
17+
18+
headers: Dict[str, str] = client.get_headers()
19+
cookies: Dict[str, Any] = client.get_cookies()
20+
21+
# Set the proxies if the client has proxies set.
22+
proxies = None
23+
if hasattr(client, "proxies") and client.proxies is not None:
24+
https_proxy = client.proxies.get("https")
25+
if https_proxy:
26+
proxies = https_proxy
27+
else:
28+
http_proxy = client.proxies.get("http")
29+
if http_proxy:
30+
proxies = http_proxy
31+
32+
return {
33+
"method": "post",
34+
"url": url,
35+
"headers": headers,
36+
"cookies": cookies,
37+
"timeout": client.get_timeout(),
38+
"proxies": proxies,
39+
}
40+
41+
42+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, Error]]:
43+
if response.status_code == HTTPStatus.OK:
44+
response_200 = cast(Any, None)
45+
return response_200
46+
if response.status_code == HTTPStatus.FORBIDDEN:
47+
response_403 = Error.from_dict(response.json())
48+
49+
return response_403
50+
if response.status_code == HTTPStatus.NOT_FOUND:
51+
response_404 = Error.from_dict(response.json())
52+
53+
return response_404
54+
if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR:
55+
response_500 = Error.from_dict(response.json())
56+
57+
return response_500
58+
if client.raise_on_unexpected_status:
59+
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code} ({response})")
60+
else:
61+
return None
62+
63+
64+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, Error]]:
65+
return Response(
66+
status_code=HTTPStatus(response.status_code),
67+
content=response.content,
68+
headers=response.headers,
69+
parsed=_parse_response(client=client, response=response),
70+
)
71+
72+
73+
def sync_detailed(
74+
*,
75+
client: Client,
76+
) -> Response[Union[Any, Error]]:
77+
"""Build the global catalog on the root instance
78+
79+
Raises:
80+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81+
httpx.TimeoutException: If the request takes longer than Client.timeout.
82+
83+
Returns:
84+
Response[Union[Any, Error]]
85+
"""
86+
87+
kwargs = _get_kwargs(
88+
client=client,
89+
)
90+
91+
response = httpx.request(
92+
verify=client.verify_ssl,
93+
**kwargs,
94+
)
95+
96+
return _build_response(client=client, response=response)
97+
98+
99+
def sync(
100+
*,
101+
client: Client,
102+
) -> Optional[Union[Any, Error]]:
103+
"""Build the global catalog on the root instance
104+
105+
Raises:
106+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
107+
httpx.TimeoutException: If the request takes longer than Client.timeout.
108+
109+
Returns:
110+
Response[Union[Any, Error]]
111+
"""
112+
113+
return sync_detailed(
114+
client=client,
115+
).parsed
116+
117+
118+
async def asyncio_detailed(
119+
*,
120+
client: Client,
121+
) -> Response[Union[Any, Error]]:
122+
"""Build the global catalog on the root instance
123+
124+
Raises:
125+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
126+
httpx.TimeoutException: If the request takes longer than Client.timeout.
127+
128+
Returns:
129+
Response[Union[Any, Error]]
130+
"""
131+
132+
kwargs = _get_kwargs(
133+
client=client,
134+
)
135+
136+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
137+
response = await _client.request(**kwargs)
138+
139+
return _build_response(client=client, response=response)
140+
141+
142+
async def asyncio(
143+
*,
144+
client: Client,
145+
) -> Optional[Union[Any, Error]]:
146+
"""Build the global catalog on the root instance
147+
148+
Raises:
149+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
150+
httpx.TimeoutException: If the request takes longer than Client.timeout.
151+
152+
Returns:
153+
Response[Union[Any, Error]]
154+
"""
155+
156+
return (
157+
await asyncio_detailed(
158+
client=client,
159+
)
160+
).parsed

src/tuneinsight/api/sdk/api/api_ontology/get_ontology_search.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def _get_kwargs(
1717
per_page: Union[Unset, None, int] = 30,
1818
page: Union[Unset, None, int] = 1,
1919
query: str,
20+
with_occurrence: Union[Unset, None, bool] = UNSET,
21+
with_network_occurrence: Union[Unset, None, bool] = UNSET,
2022
ontologies: List[GetOntologySearchOntologiesItem],
2123
) -> Dict[str, Any]:
2224
url = "{}/ontology-search".format(client.base_url)
@@ -31,6 +33,10 @@ def _get_kwargs(
3133

3234
params["query"] = query
3335

36+
params["withOccurrence"] = with_occurrence
37+
38+
params["withNetworkOccurrence"] = with_network_occurrence
39+
3440
json_ontologies = []
3541
for ontologies_item_data in ontologies:
3642
ontologies_item = ontologies_item_data.value
@@ -110,6 +116,8 @@ def sync_detailed(
110116
per_page: Union[Unset, None, int] = 30,
111117
page: Union[Unset, None, int] = 1,
112118
query: str,
119+
with_occurrence: Union[Unset, None, bool] = UNSET,
120+
with_network_occurrence: Union[Unset, None, bool] = UNSET,
113121
ontologies: List[GetOntologySearchOntologiesItem],
114122
) -> Response[Union[Error, List["GetOntologySearchResponse200Item"]]]:
115123
"""Search ontologies with a search term
@@ -118,6 +126,8 @@ def sync_detailed(
118126
per_page (Union[Unset, None, int]): Default: 30.
119127
page (Union[Unset, None, int]): Default: 1.
120128
query (str):
129+
with_occurrence (Union[Unset, None, bool]):
130+
with_network_occurrence (Union[Unset, None, bool]):
121131
ontologies (List[GetOntologySearchOntologiesItem]):
122132
123133
Raises:
@@ -133,6 +143,8 @@ def sync_detailed(
133143
per_page=per_page,
134144
page=page,
135145
query=query,
146+
with_occurrence=with_occurrence,
147+
with_network_occurrence=with_network_occurrence,
136148
ontologies=ontologies,
137149
)
138150

@@ -150,6 +162,8 @@ def sync(
150162
per_page: Union[Unset, None, int] = 30,
151163
page: Union[Unset, None, int] = 1,
152164
query: str,
165+
with_occurrence: Union[Unset, None, bool] = UNSET,
166+
with_network_occurrence: Union[Unset, None, bool] = UNSET,
153167
ontologies: List[GetOntologySearchOntologiesItem],
154168
) -> Optional[Union[Error, List["GetOntologySearchResponse200Item"]]]:
155169
"""Search ontologies with a search term
@@ -158,6 +172,8 @@ def sync(
158172
per_page (Union[Unset, None, int]): Default: 30.
159173
page (Union[Unset, None, int]): Default: 1.
160174
query (str):
175+
with_occurrence (Union[Unset, None, bool]):
176+
with_network_occurrence (Union[Unset, None, bool]):
161177
ontologies (List[GetOntologySearchOntologiesItem]):
162178
163179
Raises:
@@ -173,6 +189,8 @@ def sync(
173189
per_page=per_page,
174190
page=page,
175191
query=query,
192+
with_occurrence=with_occurrence,
193+
with_network_occurrence=with_network_occurrence,
176194
ontologies=ontologies,
177195
).parsed
178196

@@ -183,6 +201,8 @@ async def asyncio_detailed(
183201
per_page: Union[Unset, None, int] = 30,
184202
page: Union[Unset, None, int] = 1,
185203
query: str,
204+
with_occurrence: Union[Unset, None, bool] = UNSET,
205+
with_network_occurrence: Union[Unset, None, bool] = UNSET,
186206
ontologies: List[GetOntologySearchOntologiesItem],
187207
) -> Response[Union[Error, List["GetOntologySearchResponse200Item"]]]:
188208
"""Search ontologies with a search term
@@ -191,6 +211,8 @@ async def asyncio_detailed(
191211
per_page (Union[Unset, None, int]): Default: 30.
192212
page (Union[Unset, None, int]): Default: 1.
193213
query (str):
214+
with_occurrence (Union[Unset, None, bool]):
215+
with_network_occurrence (Union[Unset, None, bool]):
194216
ontologies (List[GetOntologySearchOntologiesItem]):
195217
196218
Raises:
@@ -206,6 +228,8 @@ async def asyncio_detailed(
206228
per_page=per_page,
207229
page=page,
208230
query=query,
231+
with_occurrence=with_occurrence,
232+
with_network_occurrence=with_network_occurrence,
209233
ontologies=ontologies,
210234
)
211235

@@ -221,6 +245,8 @@ async def asyncio(
221245
per_page: Union[Unset, None, int] = 30,
222246
page: Union[Unset, None, int] = 1,
223247
query: str,
248+
with_occurrence: Union[Unset, None, bool] = UNSET,
249+
with_network_occurrence: Union[Unset, None, bool] = UNSET,
224250
ontologies: List[GetOntologySearchOntologiesItem],
225251
) -> Optional[Union[Error, List["GetOntologySearchResponse200Item"]]]:
226252
"""Search ontologies with a search term
@@ -229,6 +255,8 @@ async def asyncio(
229255
per_page (Union[Unset, None, int]): Default: 30.
230256
page (Union[Unset, None, int]): Default: 1.
231257
query (str):
258+
with_occurrence (Union[Unset, None, bool]):
259+
with_network_occurrence (Union[Unset, None, bool]):
232260
ontologies (List[GetOntologySearchOntologiesItem]):
233261
234262
Raises:
@@ -245,6 +273,8 @@ async def asyncio(
245273
per_page=per_page,
246274
page=page,
247275
query=query,
276+
with_occurrence=with_occurrence,
277+
with_network_occurrence=with_network_occurrence,
248278
ontologies=ontologies,
249279
)
250280
).parsed

src/tuneinsight/api/sdk/api/api_project/post_project.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
6262
response_403 = Error.from_dict(response.json())
6363

6464
return response_403
65+
if response.status_code == HTTPStatus.CONFLICT:
66+
response_409 = Error.from_dict(response.json())
67+
68+
return response_409
6569
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
6670
response_422 = Error.from_dict(response.json())
6771

0 commit comments

Comments
 (0)