funapi-sciencedb 1.0.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.
- funapi_sciencedb-1.0.1.dist-info/LICENSE +21 -0
- funapi_sciencedb-1.0.1.dist-info/METADATA +10 -0
- funapi_sciencedb-1.0.1.dist-info/RECORD +54 -0
- funapi_sciencedb-1.0.1.dist-info/WHEEL +5 -0
- funapi_sciencedb-1.0.1.dist-info/top_level.txt +1 -0
- sciencedb/__init__.py +8 -0
- sciencedb/api/__init__.py +1 -0
- sciencedb/api/open_api_controller/__init__.py +0 -0
- sciencedb/api/open_api_controller/harvest_using_get.py +211 -0
- sciencedb/api/open_api_controller/json_using_get.py +164 -0
- sciencedb/api/open_api_controller/metrics_using_get.py +166 -0
- sciencedb/api/open_api_controller/search_using_get.py +196 -0
- sciencedb/api/sushi_controller/__init__.py +0 -0
- sciencedb/api/sushi_controller/get_api_status.py +171 -0
- sciencedb/api/sushi_controller/get_report_by_id_using_get.py +173 -0
- sciencedb/api/sushi_controller/get_reports.py +181 -0
- sciencedb/client.py +286 -0
- sciencedb/errors.py +16 -0
- sciencedb/models/__init__.py +75 -0
- sciencedb/models/api_result_metrics_result.py +99 -0
- sciencedb/models/api_result_search_result.py +99 -0
- sciencedb/models/counter_dataset_attributes.py +69 -0
- sciencedb/models/counter_dataset_attributes_type.py +10 -0
- sciencedb/models/counter_dataset_contributors.py +68 -0
- sciencedb/models/counter_dataset_contributors_type.py +10 -0
- sciencedb/models/counter_dataset_dates.py +68 -0
- sciencedb/models/counter_dataset_dates_type.py +10 -0
- sciencedb/models/counter_dataset_identifiers.py +68 -0
- sciencedb/models/counter_dataset_identifiers_type.py +10 -0
- sciencedb/models/counter_dataset_instance.py +98 -0
- sciencedb/models/counter_dataset_instance_access_method.py +9 -0
- sciencedb/models/counter_dataset_instance_metric_type.py +11 -0
- sciencedb/models/counter_dataset_performance.py +82 -0
- sciencedb/models/counter_dataset_period.py +83 -0
- sciencedb/models/counter_dataset_report.py +106 -0
- sciencedb/models/counter_dataset_usage.py +230 -0
- sciencedb/models/counter_dataset_usage_data_type.py +8 -0
- sciencedb/models/counter_publisher_identifiers.py +68 -0
- sciencedb/models/counter_publisher_identifiers_type.py +10 -0
- sciencedb/models/metrics_result.py +95 -0
- sciencedb/models/search_record.py +150 -0
- sciencedb/models/search_result.py +111 -0
- sciencedb/models/sushi_error_model.py +97 -0
- sciencedb/models/sushi_error_model_severity.py +11 -0
- sciencedb/models/sushi_page_meta.py +77 -0
- sciencedb/models/sushi_report.py +72 -0
- sciencedb/models/sushi_report_header.py +189 -0
- sciencedb/models/sushi_report_header_report_attributes_item.py +43 -0
- sciencedb/models/sushi_report_header_report_filters_item.py +43 -0
- sciencedb/models/sushi_report_list.py +82 -0
- sciencedb/models/sushi_report_page.py +93 -0
- sciencedb/models/sushi_service_status.py +118 -0
- sciencedb/models/sushi_service_status_alerts_item.py +43 -0
- sciencedb/types.py +53 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 farfarfun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
sciencedb/__init__.py,sha256=V91OH0M-9cEXIaIVSroxi-XP3iIAamKBYTSnkC4n4Qs,160
|
|
2
|
+
sciencedb/client.py,sha256=Mx4LXjZbK6bti5dPVDfVgFsP9ekQRfjewsSm5crGauw,12587
|
|
3
|
+
sciencedb/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
|
|
4
|
+
sciencedb/types.py,sha256=2xUeMaB-EwpnPJDYkcb3LWVuhevucRUY2Mgzsa0Mh_Y,1018
|
|
5
|
+
sciencedb/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
|
|
6
|
+
sciencedb/api/open_api_controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
sciencedb/api/open_api_controller/harvest_using_get.py,sha256=LBmjInbRAESpd9hyRZcGUaPkcSt0pJo45cWVkSFbGSw,6204
|
|
8
|
+
sciencedb/api/open_api_controller/json_using_get.py,sha256=A0HLllE8UliubUoB4UReiAUHciLRrQCQoQJS1Jk5vQw,3930
|
|
9
|
+
sciencedb/api/open_api_controller/metrics_using_get.py,sha256=ZR_w92J3tS923lLTp_JUe3AnzgTZ_mS2-Pp0W4gUfAA,4012
|
|
10
|
+
sciencedb/api/open_api_controller/search_using_get.py,sha256=MENCXbnRbwnul9f4ekuR_jnPpHUTob29UC77nl2W2iE,5156
|
|
11
|
+
sciencedb/api/sushi_controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
sciencedb/api/sushi_controller/get_api_status.py,sha256=DmRLH2WruPskziR9e5mhkvsdhVRhAP2Wa2Xn_mNWuP0,4667
|
|
13
|
+
sciencedb/api/sushi_controller/get_report_by_id_using_get.py,sha256=V286cAI-04YAzyMFhpWI1L_3cKyWpaB6Hzh9lAF8oI0,4352
|
|
14
|
+
sciencedb/api/sushi_controller/get_reports.py,sha256=EV4swB2EKQql9cwlGBRpXMroFd8wK86mtud2EWx58ZU,4955
|
|
15
|
+
sciencedb/models/__init__.py,sha256=YhYVI3mUmNCsNYPxXKRBVgt-yRjjR36mXAp9jkvNexc,3252
|
|
16
|
+
sciencedb/models/api_result_metrics_result.py,sha256=XNMptlNO4tuYN_jUVb4umviykC-Xle6jGXJy2D6_e64,3011
|
|
17
|
+
sciencedb/models/api_result_search_result.py,sha256=4knozJH6K_JbtQnWgo7b0ElLoyvn2fvpvqB6YHCPKV0,2983
|
|
18
|
+
sciencedb/models/counter_dataset_attributes.py,sha256=GAMQp0wH3BReOPUQbd1yVbHZqIj4kL_quScJMRyBq1U,1970
|
|
19
|
+
sciencedb/models/counter_dataset_attributes_type.py,sha256=7A1_qRseRqhzUFpd7qX54_nzY41wvnBVZpvIVOEeIeg,240
|
|
20
|
+
sciencedb/models/counter_dataset_contributors.py,sha256=SK_LyuUYM2SvF5imgEBqVNhz4MIfjqOUSDtNGsDDYRc,1900
|
|
21
|
+
sciencedb/models/counter_dataset_contributors_type.py,sha256=NUiOnJP7OuKPIBhVWvCbVwjGNv0HhnWrRsaJN6zFS5s,191
|
|
22
|
+
sciencedb/models/counter_dataset_dates.py,sha256=qLSA6E4jrQ91De-MbQoPrE_j8sjHLGfOu6gbs-dZTMM,1824
|
|
23
|
+
sciencedb/models/counter_dataset_dates_type.py,sha256=Fapb3S4ypDz1QHHtIYPu5snKvqEhEaXP34X0uyW76h8,238
|
|
24
|
+
sciencedb/models/counter_dataset_identifiers.py,sha256=e8TQ0CwKqJF1DlCeKprV5D2bFSITuZcJFPgf7-bA41M,1883
|
|
25
|
+
sciencedb/models/counter_dataset_identifiers_type.py,sha256=SFfF2JtrlK7b2bIvZFUQCehsGpJwc1iXGmEUMJmU7_Q,198
|
|
26
|
+
sciencedb/models/counter_dataset_instance.py,sha256=84KP4OSW-L4wx3L8sp0TQohmb7EzozRMJSS7xU-0f-4,3469
|
|
27
|
+
sciencedb/models/counter_dataset_instance_access_method.py,sha256=8Egul__krTQCCWwuoy2nobB3y6a4DZsyEqqIdhEjjgM,187
|
|
28
|
+
sciencedb/models/counter_dataset_instance_metric_type.py,sha256=pyWsNFJS-_Ebk_KOiG5P97gcjOgriH4eI31WoqPFIP8,381
|
|
29
|
+
sciencedb/models/counter_dataset_performance.py,sha256=EjMtU2CS4867qf3MVNxeSih6USa4DB3JBQHIIKBroLg,2484
|
|
30
|
+
sciencedb/models/counter_dataset_period.py,sha256=BvSnvPUXYVHImdNvU551DjJmZTQEIOH8ZyuV9y2UhoE,2583
|
|
31
|
+
sciencedb/models/counter_dataset_report.py,sha256=hJybN8e8x-R7vOV1ZzRt7jNvSg8oPKhGGHzrpuHr77U,3884
|
|
32
|
+
sciencedb/models/counter_dataset_usage.py,sha256=EZIHyeoxGN8P87koowXLGTHWzw7SUY1_wbHjk1nc9-U,9600
|
|
33
|
+
sciencedb/models/counter_dataset_usage_data_type.py,sha256=g3nXQYXS1GtIxwGW85Tk-1vdAvx7n_Vxfj3SuTtHkOc,156
|
|
34
|
+
sciencedb/models/counter_publisher_identifiers.py,sha256=xJfX4mU_grhxnTKwZkvcv7OE4K5fLlIwbUYcm6Nze7w,1918
|
|
35
|
+
sciencedb/models/counter_publisher_identifiers_type.py,sha256=RWWVwYD4xDkwmNTSEW9vfSxG__ddgJFz61wzWkcqbbQ,192
|
|
36
|
+
sciencedb/models/metrics_result.py,sha256=xMjZkNxg9VX-geZIB101hP1gJbCdSr9PJfEEb0gSpSQ,2828
|
|
37
|
+
sciencedb/models/search_record.py,sha256=08Mdz0U8hYFGeLurdPcevDGGwuQuR_7pSF1YoNX1rYk,4755
|
|
38
|
+
sciencedb/models/search_result.py,sha256=Ib6hRwZYgWnHnUqGDR45I9-nsg-wl6TiMSfXmqH9f60,3626
|
|
39
|
+
sciencedb/models/sushi_error_model.py,sha256=q646tZYR6U5W5OHljW1BRvmhQGExAcgKlS_mBd4XSAY,2852
|
|
40
|
+
sciencedb/models/sushi_error_model_severity.py,sha256=zP8jZ9XL-cmIRQz-KTGI_pkhVtjZpas_piPAF444YPM,210
|
|
41
|
+
sciencedb/models/sushi_page_meta.py,sha256=KFx45QKzGxzwxuewm1WjgWCBsO4LrLnMRpUhKyZ2hTQ,2161
|
|
42
|
+
sciencedb/models/sushi_report.py,sha256=K_invAOd4qTjmu_3rHeOZIuEbRz7_7oSjHnMiwnFhfA,2204
|
|
43
|
+
sciencedb/models/sushi_report_header.py,sha256=4cEL5mydXu7hSz5-3lDBYIzDZ_fNTP6CGkgzFl3SVQA,7314
|
|
44
|
+
sciencedb/models/sushi_report_header_report_attributes_item.py,sha256=BPEzyUMdOgmoCwASUSPcehiC2cvd-SV-eqEs9mC4zFM,1322
|
|
45
|
+
sciencedb/models/sushi_report_header_report_filters_item.py,sha256=BLGSq2xGz1gimLYJDEZgWkNFoK1uzrfvD4sRh7FCwlc,1307
|
|
46
|
+
sciencedb/models/sushi_report_list.py,sha256=SKIzqvAsgNbhp73h7Uwb1v208GQ7U5vmRUhkW3D0QB4,2601
|
|
47
|
+
sciencedb/models/sushi_report_page.py,sha256=xqAxKetYCZZF2_nFQCoiTM363gkXNAMeL-H_JOsKJTs,2903
|
|
48
|
+
sciencedb/models/sushi_service_status.py,sha256=jXhdm1x7ZjfP1kQURGZdU-Jst9vnUySrMsCcNoHw4Ws,3994
|
|
49
|
+
sciencedb/models/sushi_service_status_alerts_item.py,sha256=MZqNptq4RWtHhhaMOfPhoHHuv5l5-AxMqRkYEVr7Hds,1274
|
|
50
|
+
funapi_sciencedb-1.0.1.dist-info/LICENSE,sha256=kFhh2Ic-COMui7QuYjzcmt7EtGdwmfJv310FysTA1xs,1066
|
|
51
|
+
funapi_sciencedb-1.0.1.dist-info/METADATA,sha256=o70_1gkuLFk5zltab41kbL7LKnXTPXHh7CtfGpaxsSE,231
|
|
52
|
+
funapi_sciencedb-1.0.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
53
|
+
funapi_sciencedb-1.0.1.dist-info/top_level.txt,sha256=MiOCa6euMYm4vdHz6XNrde4Ha-9m8ebf4DEVHnUfenI,10
|
|
54
|
+
funapi_sciencedb-1.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sciencedb
|
sciencedb/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
File without changes
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.api_result_search_result import APIResultSearchResult
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
end_time: Union[Unset, str] = "2099-01-01",
|
|
15
|
+
page: Union[Unset, int] = 1,
|
|
16
|
+
size: Union[Unset, int] = 10,
|
|
17
|
+
start_time: Union[Unset, str] = "1970-01-01",
|
|
18
|
+
) -> Dict[str, Any]:
|
|
19
|
+
params: Dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
params["end_time"] = end_time
|
|
22
|
+
|
|
23
|
+
params["page"] = page
|
|
24
|
+
|
|
25
|
+
params["size"] = size
|
|
26
|
+
|
|
27
|
+
params["start_time"] = start_time
|
|
28
|
+
|
|
29
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
30
|
+
|
|
31
|
+
_kwargs: Dict[str, Any] = {
|
|
32
|
+
"method": "get",
|
|
33
|
+
"url": "/harvest",
|
|
34
|
+
"params": params,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return _kwargs
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _parse_response(
|
|
41
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
42
|
+
) -> Optional[APIResultSearchResult]:
|
|
43
|
+
if response.status_code == 200:
|
|
44
|
+
response_200 = APIResultSearchResult.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
return response_200
|
|
47
|
+
if client.raise_on_unexpected_status:
|
|
48
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
49
|
+
else:
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _build_response(
|
|
54
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
55
|
+
) -> Response[APIResultSearchResult]:
|
|
56
|
+
return Response(
|
|
57
|
+
status_code=HTTPStatus(response.status_code),
|
|
58
|
+
content=response.content,
|
|
59
|
+
headers=response.headers,
|
|
60
|
+
parsed=_parse_response(client=client, response=response),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def sync_detailed(
|
|
65
|
+
*,
|
|
66
|
+
client: Union[AuthenticatedClient, Client],
|
|
67
|
+
end_time: Union[Unset, str] = "2099-01-01",
|
|
68
|
+
page: Union[Unset, int] = 1,
|
|
69
|
+
size: Union[Unset, int] = 10,
|
|
70
|
+
start_time: Union[Unset, str] = "1970-01-01",
|
|
71
|
+
) -> Response[APIResultSearchResult]:
|
|
72
|
+
"""harvest dataset by dataset's publish time period(start_time and end_time)
|
|
73
|
+
|
|
74
|
+
result is order by publish time desc
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
end_time (Union[Unset, str]): Default: '2099-01-01'.
|
|
78
|
+
page (Union[Unset, int]): Default: 1.
|
|
79
|
+
size (Union[Unset, int]): Default: 10.
|
|
80
|
+
start_time (Union[Unset, str]): Default: '1970-01-01'.
|
|
81
|
+
|
|
82
|
+
Raises:
|
|
83
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
84
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Response[APIResultSearchResult]
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
kwargs = _get_kwargs(
|
|
91
|
+
end_time=end_time,
|
|
92
|
+
page=page,
|
|
93
|
+
size=size,
|
|
94
|
+
start_time=start_time,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
response = client.get_httpx_client().request(
|
|
98
|
+
**kwargs,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return _build_response(client=client, response=response)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def sync(
|
|
105
|
+
*,
|
|
106
|
+
client: Union[AuthenticatedClient, Client],
|
|
107
|
+
end_time: Union[Unset, str] = "2099-01-01",
|
|
108
|
+
page: Union[Unset, int] = 1,
|
|
109
|
+
size: Union[Unset, int] = 10,
|
|
110
|
+
start_time: Union[Unset, str] = "1970-01-01",
|
|
111
|
+
) -> Optional[APIResultSearchResult]:
|
|
112
|
+
"""harvest dataset by dataset's publish time period(start_time and end_time)
|
|
113
|
+
|
|
114
|
+
result is order by publish time desc
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
end_time (Union[Unset, str]): Default: '2099-01-01'.
|
|
118
|
+
page (Union[Unset, int]): Default: 1.
|
|
119
|
+
size (Union[Unset, int]): Default: 10.
|
|
120
|
+
start_time (Union[Unset, str]): Default: '1970-01-01'.
|
|
121
|
+
|
|
122
|
+
Raises:
|
|
123
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
124
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
APIResultSearchResult
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
return sync_detailed(
|
|
131
|
+
client=client,
|
|
132
|
+
end_time=end_time,
|
|
133
|
+
page=page,
|
|
134
|
+
size=size,
|
|
135
|
+
start_time=start_time,
|
|
136
|
+
).parsed
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def asyncio_detailed(
|
|
140
|
+
*,
|
|
141
|
+
client: Union[AuthenticatedClient, Client],
|
|
142
|
+
end_time: Union[Unset, str] = "2099-01-01",
|
|
143
|
+
page: Union[Unset, int] = 1,
|
|
144
|
+
size: Union[Unset, int] = 10,
|
|
145
|
+
start_time: Union[Unset, str] = "1970-01-01",
|
|
146
|
+
) -> Response[APIResultSearchResult]:
|
|
147
|
+
"""harvest dataset by dataset's publish time period(start_time and end_time)
|
|
148
|
+
|
|
149
|
+
result is order by publish time desc
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
end_time (Union[Unset, str]): Default: '2099-01-01'.
|
|
153
|
+
page (Union[Unset, int]): Default: 1.
|
|
154
|
+
size (Union[Unset, int]): Default: 10.
|
|
155
|
+
start_time (Union[Unset, str]): Default: '1970-01-01'.
|
|
156
|
+
|
|
157
|
+
Raises:
|
|
158
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
159
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
Response[APIResultSearchResult]
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
kwargs = _get_kwargs(
|
|
166
|
+
end_time=end_time,
|
|
167
|
+
page=page,
|
|
168
|
+
size=size,
|
|
169
|
+
start_time=start_time,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
173
|
+
|
|
174
|
+
return _build_response(client=client, response=response)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
async def asyncio(
|
|
178
|
+
*,
|
|
179
|
+
client: Union[AuthenticatedClient, Client],
|
|
180
|
+
end_time: Union[Unset, str] = "2099-01-01",
|
|
181
|
+
page: Union[Unset, int] = 1,
|
|
182
|
+
size: Union[Unset, int] = 10,
|
|
183
|
+
start_time: Union[Unset, str] = "1970-01-01",
|
|
184
|
+
) -> Optional[APIResultSearchResult]:
|
|
185
|
+
"""harvest dataset by dataset's publish time period(start_time and end_time)
|
|
186
|
+
|
|
187
|
+
result is order by publish time desc
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
end_time (Union[Unset, str]): Default: '2099-01-01'.
|
|
191
|
+
page (Union[Unset, int]): Default: 1.
|
|
192
|
+
size (Union[Unset, int]): Default: 10.
|
|
193
|
+
start_time (Union[Unset, str]): Default: '1970-01-01'.
|
|
194
|
+
|
|
195
|
+
Raises:
|
|
196
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
197
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
APIResultSearchResult
|
|
201
|
+
"""
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
await asyncio_detailed(
|
|
205
|
+
client=client,
|
|
206
|
+
end_time=end_time,
|
|
207
|
+
page=page,
|
|
208
|
+
size=size,
|
|
209
|
+
start_time=start_time,
|
|
210
|
+
)
|
|
211
|
+
).parsed
|
|
@@ -0,0 +1,164 @@
|
|
|
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 AuthenticatedClient, Client
|
|
8
|
+
from ...types import UNSET, Response
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _get_kwargs(
|
|
12
|
+
*,
|
|
13
|
+
doi: str,
|
|
14
|
+
) -> Dict[str, Any]:
|
|
15
|
+
params: Dict[str, Any] = {}
|
|
16
|
+
|
|
17
|
+
params["doi"] = doi
|
|
18
|
+
|
|
19
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
20
|
+
|
|
21
|
+
_kwargs: Dict[str, Any] = {
|
|
22
|
+
"method": "get",
|
|
23
|
+
"url": "/json",
|
|
24
|
+
"params": params,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return _kwargs
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _parse_response(
|
|
31
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
32
|
+
) -> Optional[str]:
|
|
33
|
+
if response.status_code == 200:
|
|
34
|
+
response_200 = cast(str, response.json())
|
|
35
|
+
return response_200
|
|
36
|
+
if client.raise_on_unexpected_status:
|
|
37
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
38
|
+
else:
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _build_response(
|
|
43
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
44
|
+
) -> Response[str]:
|
|
45
|
+
return Response(
|
|
46
|
+
status_code=HTTPStatus(response.status_code),
|
|
47
|
+
content=response.content,
|
|
48
|
+
headers=response.headers,
|
|
49
|
+
parsed=_parse_response(client=client, response=response),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def sync_detailed(
|
|
54
|
+
*,
|
|
55
|
+
client: Union[AuthenticatedClient, Client],
|
|
56
|
+
doi: str,
|
|
57
|
+
) -> Response[str]:
|
|
58
|
+
"""get dataset's detail information by it's doi
|
|
59
|
+
|
|
60
|
+
information's format is referenced by https://schema.org/Dataset
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
doi (str):
|
|
64
|
+
|
|
65
|
+
Raises:
|
|
66
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
67
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
Response[str]
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
kwargs = _get_kwargs(
|
|
74
|
+
doi=doi,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
response = client.get_httpx_client().request(
|
|
78
|
+
**kwargs,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
return _build_response(client=client, response=response)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def sync(
|
|
85
|
+
*,
|
|
86
|
+
client: Union[AuthenticatedClient, Client],
|
|
87
|
+
doi: str,
|
|
88
|
+
) -> Optional[str]:
|
|
89
|
+
"""get dataset's detail information by it's doi
|
|
90
|
+
|
|
91
|
+
information's format is referenced by https://schema.org/Dataset
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
doi (str):
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
str
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
return sync_detailed(
|
|
105
|
+
client=client,
|
|
106
|
+
doi=doi,
|
|
107
|
+
).parsed
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
async def asyncio_detailed(
|
|
111
|
+
*,
|
|
112
|
+
client: Union[AuthenticatedClient, Client],
|
|
113
|
+
doi: str,
|
|
114
|
+
) -> Response[str]:
|
|
115
|
+
"""get dataset's detail information by it's doi
|
|
116
|
+
|
|
117
|
+
information's format is referenced by https://schema.org/Dataset
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
doi (str):
|
|
121
|
+
|
|
122
|
+
Raises:
|
|
123
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
124
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Response[str]
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
kwargs = _get_kwargs(
|
|
131
|
+
doi=doi,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
135
|
+
|
|
136
|
+
return _build_response(client=client, response=response)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def asyncio(
|
|
140
|
+
*,
|
|
141
|
+
client: Union[AuthenticatedClient, Client],
|
|
142
|
+
doi: str,
|
|
143
|
+
) -> Optional[str]:
|
|
144
|
+
"""get dataset's detail information by it's doi
|
|
145
|
+
|
|
146
|
+
information's format is referenced by https://schema.org/Dataset
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
doi (str):
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
153
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
str
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
await asyncio_detailed(
|
|
161
|
+
client=client,
|
|
162
|
+
doi=doi,
|
|
163
|
+
)
|
|
164
|
+
).parsed
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.api_result_metrics_result import APIResultMetricsResult
|
|
9
|
+
from ...types import UNSET, Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
doi: str,
|
|
15
|
+
) -> Dict[str, Any]:
|
|
16
|
+
params: Dict[str, Any] = {}
|
|
17
|
+
|
|
18
|
+
params["doi"] = doi
|
|
19
|
+
|
|
20
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
21
|
+
|
|
22
|
+
_kwargs: Dict[str, Any] = {
|
|
23
|
+
"method": "get",
|
|
24
|
+
"url": "/metrics",
|
|
25
|
+
"params": params,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return _kwargs
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _parse_response(
|
|
32
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
33
|
+
) -> Optional[APIResultMetricsResult]:
|
|
34
|
+
if response.status_code == 200:
|
|
35
|
+
response_200 = APIResultMetricsResult.from_dict(response.json())
|
|
36
|
+
|
|
37
|
+
return response_200
|
|
38
|
+
if client.raise_on_unexpected_status:
|
|
39
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
40
|
+
else:
|
|
41
|
+
return None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _build_response(
|
|
45
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
46
|
+
) -> Response[APIResultMetricsResult]:
|
|
47
|
+
return Response(
|
|
48
|
+
status_code=HTTPStatus(response.status_code),
|
|
49
|
+
content=response.content,
|
|
50
|
+
headers=response.headers,
|
|
51
|
+
parsed=_parse_response(client=client, response=response),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def sync_detailed(
|
|
56
|
+
*,
|
|
57
|
+
client: Union[AuthenticatedClient, Client],
|
|
58
|
+
doi: str,
|
|
59
|
+
) -> Response[APIResultMetricsResult]:
|
|
60
|
+
"""search dataset metrics by doi
|
|
61
|
+
|
|
62
|
+
search dataset metrics by doi
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
doi (str):
|
|
66
|
+
|
|
67
|
+
Raises:
|
|
68
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
69
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Response[APIResultMetricsResult]
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
kwargs = _get_kwargs(
|
|
76
|
+
doi=doi,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
response = client.get_httpx_client().request(
|
|
80
|
+
**kwargs,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return _build_response(client=client, response=response)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def sync(
|
|
87
|
+
*,
|
|
88
|
+
client: Union[AuthenticatedClient, Client],
|
|
89
|
+
doi: str,
|
|
90
|
+
) -> Optional[APIResultMetricsResult]:
|
|
91
|
+
"""search dataset metrics by doi
|
|
92
|
+
|
|
93
|
+
search dataset metrics by doi
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
doi (str):
|
|
97
|
+
|
|
98
|
+
Raises:
|
|
99
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
100
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
APIResultMetricsResult
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
return sync_detailed(
|
|
107
|
+
client=client,
|
|
108
|
+
doi=doi,
|
|
109
|
+
).parsed
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
async def asyncio_detailed(
|
|
113
|
+
*,
|
|
114
|
+
client: Union[AuthenticatedClient, Client],
|
|
115
|
+
doi: str,
|
|
116
|
+
) -> Response[APIResultMetricsResult]:
|
|
117
|
+
"""search dataset metrics by doi
|
|
118
|
+
|
|
119
|
+
search dataset metrics by doi
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
doi (str):
|
|
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[APIResultMetricsResult]
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
kwargs = _get_kwargs(
|
|
133
|
+
doi=doi,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
137
|
+
|
|
138
|
+
return _build_response(client=client, response=response)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
async def asyncio(
|
|
142
|
+
*,
|
|
143
|
+
client: Union[AuthenticatedClient, Client],
|
|
144
|
+
doi: str,
|
|
145
|
+
) -> Optional[APIResultMetricsResult]:
|
|
146
|
+
"""search dataset metrics by doi
|
|
147
|
+
|
|
148
|
+
search dataset metrics by doi
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
doi (str):
|
|
152
|
+
|
|
153
|
+
Raises:
|
|
154
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
155
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
APIResultMetricsResult
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
await asyncio_detailed(
|
|
163
|
+
client=client,
|
|
164
|
+
doi=doi,
|
|
165
|
+
)
|
|
166
|
+
).parsed
|