athena-intelligence 0.1.98__tar.gz → 0.1.99__tar.gz
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.
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/PKG-INFO +1 -1
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/pyproject.toml +1 -1
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/client.py +17 -17
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/client_wrapper.py +1 -1
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/tools/client.py +16 -22
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/data_frame_parsing_error.py +1 -1
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/data_frame_unknown_format_error.py +1 -1
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/README.md +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/__init__.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/base_client.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/__init__.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/api_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/datetime_utils.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/file.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/http_client.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/jsonable_encoder.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/pydantic_utilities.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/query_encoder.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/remove_none_from_dict.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/request_options.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/environment.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/errors/__init__.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/errors/internal_server_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/errors/not_found_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/errors/unprocessable_entity_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/errors/unsupported_media_type_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/py.typed +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/tools/__init__.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/tools/types/__init__.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/tools/types/tools_data_frame_request_columns_item.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/__init__.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/data_frame_request_out.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/data_frame_request_out_columns_item.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/data_frame_request_out_data_item_item.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/data_frame_request_out_index_item.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/file_fetch_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/http_validation_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/validation_error.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/validation_error_loc_item.py +0 -0
- {athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/version.py +0 -0
@@ -34,11 +34,11 @@ def _inherit_signature_and_doc(
|
|
34
34
|
|
35
35
|
class WrappedToolsClient(ToolsClient):
|
36
36
|
|
37
|
-
def get_file(self,
|
37
|
+
def get_file(self, asset_id: str) -> io.BytesIO:
|
38
38
|
"""
|
39
39
|
Parameters
|
40
40
|
----------
|
41
|
-
|
41
|
+
asset_id : str
|
42
42
|
|
43
43
|
Returns
|
44
44
|
-------
|
@@ -50,28 +50,28 @@ class WrappedToolsClient(ToolsClient):
|
|
50
50
|
from athena.client import Athena
|
51
51
|
|
52
52
|
client = Athena(api_key="YOUR_API_KEY")
|
53
|
-
file_io = client.tools.get_file(
|
53
|
+
file_io = client.tools.get_file(asset_id="asset_id")
|
54
54
|
pl.read_csv(file_io)
|
55
55
|
"""
|
56
|
-
file_bytes = b''.join(self.raw_data(
|
56
|
+
file_bytes = b''.join(self.raw_data(asset_id=asset_id))
|
57
57
|
bytes_io = io.BytesIO(file_bytes)
|
58
58
|
return bytes_io
|
59
59
|
|
60
60
|
@_inherit_signature_and_doc(ToolsClient.data_frame, {'DataFrameRequestOut': 'pd.DataFrame'})
|
61
|
-
def data_frame(self, *,
|
61
|
+
def data_frame(self, *, asset_id: str, **kwargs) -> 'pd.DataFrame':
|
62
62
|
_check_pandas_installed()
|
63
|
-
model = super().data_frame(
|
63
|
+
model = super().data_frame(asset_id=asset_id, **kwargs)
|
64
64
|
return _read_json_frame(model)
|
65
65
|
|
66
|
-
def read_data_frame(self,
|
66
|
+
def read_data_frame(self, asset_id: str, *args, **kwargs) -> 'pd.DataFrame':
|
67
67
|
"""
|
68
68
|
Parameters
|
69
69
|
----------
|
70
|
-
|
70
|
+
asset_id : str
|
71
71
|
|
72
72
|
**kwargs : dict
|
73
73
|
keyword arguments passed to pandas `read_csv` or `read_excel` function,
|
74
|
-
depending on the file type of the document identified by `
|
74
|
+
depending on the file type of the document identified by `asset_id`.
|
75
75
|
|
76
76
|
Returns
|
77
77
|
-------
|
@@ -82,10 +82,10 @@ class WrappedToolsClient(ToolsClient):
|
|
82
82
|
from athena.client import Athena
|
83
83
|
|
84
84
|
client = Athena(api_key="YOUR_API_KEY")
|
85
|
-
client.tools.read_data_frame(
|
85
|
+
client.tools.read_data_frame(asset_id="asset_id")
|
86
86
|
"""
|
87
87
|
_check_pandas_installed()
|
88
|
-
file_bytes = self.get_file(
|
88
|
+
file_bytes = self.get_file(asset_id)
|
89
89
|
return _to_pandas_df(file_bytes, *args, **kwargs)
|
90
90
|
|
91
91
|
|
@@ -105,21 +105,21 @@ def _add_docs_for_async_variant(obj):
|
|
105
105
|
class WrappedAsyncToolsClient(AsyncToolsClient):
|
106
106
|
|
107
107
|
@_add_docs_for_async_variant(WrappedToolsClient.get_file)
|
108
|
-
async def get_file(self,
|
109
|
-
file_bytes = b''.join([gen async for gen in self.raw_data(
|
108
|
+
async def get_file(self, asset_id: str) -> io.BytesIO:
|
109
|
+
file_bytes = b''.join([gen async for gen in self.raw_data(asset_id=asset_id)])
|
110
110
|
bytes_io = io.BytesIO(file_bytes)
|
111
111
|
return bytes_io
|
112
112
|
|
113
113
|
@_inherit_signature_and_doc(AsyncToolsClient.data_frame, {'DataFrameRequestOut': 'pd.DataFrame'})
|
114
|
-
async def data_frame(self, *,
|
114
|
+
async def data_frame(self, *, asset_id: str, **kwargs) -> 'pd.DataFrame':
|
115
115
|
_check_pandas_installed()
|
116
|
-
model = await super().data_frame(
|
116
|
+
model = await super().data_frame(asset_id=asset_id, **kwargs)
|
117
117
|
return _read_json_frame(model)
|
118
118
|
|
119
119
|
@_add_docs_for_async_variant(WrappedToolsClient.read_data_frame)
|
120
|
-
async def read_data_frame(self,
|
120
|
+
async def read_data_frame(self, asset_id: str, *args, **kwargs) -> 'pd.DataFrame':
|
121
121
|
_check_pandas_installed()
|
122
|
-
file_bytes = await self.get_file(
|
122
|
+
file_bytes = await self.get_file(asset_id)
|
123
123
|
return _to_pandas_df(file_bytes, *args, **kwargs)
|
124
124
|
|
125
125
|
|
@@ -17,7 +17,7 @@ class BaseClientWrapper:
|
|
17
17
|
headers: typing.Dict[str, str] = {
|
18
18
|
"X-Fern-Language": "Python",
|
19
19
|
"X-Fern-SDK-Name": "athena-intelligence",
|
20
|
-
"X-Fern-SDK-Version": "0.1.
|
20
|
+
"X-Fern-SDK-Version": "0.1.99",
|
21
21
|
}
|
22
22
|
headers["X-API-KEY"] = self.api_key
|
23
23
|
return headers
|
@@ -26,7 +26,7 @@ class ToolsClient:
|
|
26
26
|
def data_frame(
|
27
27
|
self,
|
28
28
|
*,
|
29
|
-
|
29
|
+
asset_id: str,
|
30
30
|
row_limit: typing.Optional[int] = None,
|
31
31
|
index_column: typing.Optional[int] = None,
|
32
32
|
columns: typing.Optional[
|
@@ -39,7 +39,7 @@ class ToolsClient:
|
|
39
39
|
"""
|
40
40
|
Parameters
|
41
41
|
----------
|
42
|
-
|
42
|
+
asset_id : str
|
43
43
|
|
44
44
|
row_limit : typing.Optional[int]
|
45
45
|
|
@@ -70,14 +70,14 @@ class ToolsClient:
|
|
70
70
|
api_key="YOUR_API_KEY",
|
71
71
|
)
|
72
72
|
client.tools.data_frame(
|
73
|
-
|
73
|
+
asset_id="asset_id",
|
74
74
|
)
|
75
75
|
"""
|
76
76
|
_response = self._client_wrapper.httpx_client.request(
|
77
77
|
"api/v0/tools/file/data-frame",
|
78
78
|
method="GET",
|
79
79
|
params={
|
80
|
-
"
|
80
|
+
"asset_id": asset_id,
|
81
81
|
"row_limit": row_limit,
|
82
82
|
"index_column": index_column,
|
83
83
|
"columns": columns,
|
@@ -107,14 +107,14 @@ class ToolsClient:
|
|
107
107
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
108
108
|
|
109
109
|
def raw_data(
|
110
|
-
self, *,
|
110
|
+
self, *, asset_id: str, request_options: typing.Optional[RequestOptions] = None
|
111
111
|
) -> typing.Iterator[bytes]:
|
112
112
|
"""
|
113
113
|
Get the raw file data for given asset.
|
114
114
|
|
115
115
|
Parameters
|
116
116
|
----------
|
117
|
-
|
117
|
+
asset_id : str
|
118
118
|
|
119
119
|
request_options : typing.Optional[RequestOptions]
|
120
120
|
Request-specific configuration.
|
@@ -132,14 +132,11 @@ class ToolsClient:
|
|
132
132
|
api_key="YOUR_API_KEY",
|
133
133
|
)
|
134
134
|
client.tools.raw_data(
|
135
|
-
|
135
|
+
asset_id="string",
|
136
136
|
)
|
137
137
|
"""
|
138
138
|
with self._client_wrapper.httpx_client.stream(
|
139
|
-
"api/v0/tools/file/raw-data",
|
140
|
-
method="GET",
|
141
|
-
params={"document_id": document_id},
|
142
|
-
request_options=request_options,
|
139
|
+
"api/v0/tools/file/raw-data", method="GET", params={"asset_id": asset_id}, request_options=request_options
|
143
140
|
) as _response:
|
144
141
|
if 200 <= _response.status_code < 300:
|
145
142
|
for _chunk in _response.iter_bytes():
|
@@ -166,7 +163,7 @@ class AsyncToolsClient:
|
|
166
163
|
async def data_frame(
|
167
164
|
self,
|
168
165
|
*,
|
169
|
-
|
166
|
+
asset_id: str,
|
170
167
|
row_limit: typing.Optional[int] = None,
|
171
168
|
index_column: typing.Optional[int] = None,
|
172
169
|
columns: typing.Optional[
|
@@ -179,7 +176,7 @@ class AsyncToolsClient:
|
|
179
176
|
"""
|
180
177
|
Parameters
|
181
178
|
----------
|
182
|
-
|
179
|
+
asset_id : str
|
183
180
|
|
184
181
|
row_limit : typing.Optional[int]
|
185
182
|
|
@@ -210,14 +207,14 @@ class AsyncToolsClient:
|
|
210
207
|
api_key="YOUR_API_KEY",
|
211
208
|
)
|
212
209
|
await client.tools.data_frame(
|
213
|
-
|
210
|
+
asset_id="asset_id",
|
214
211
|
)
|
215
212
|
"""
|
216
213
|
_response = await self._client_wrapper.httpx_client.request(
|
217
214
|
"api/v0/tools/file/data-frame",
|
218
215
|
method="GET",
|
219
216
|
params={
|
220
|
-
"
|
217
|
+
"asset_id": asset_id,
|
221
218
|
"row_limit": row_limit,
|
222
219
|
"index_column": index_column,
|
223
220
|
"columns": columns,
|
@@ -247,14 +244,14 @@ class AsyncToolsClient:
|
|
247
244
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
248
245
|
|
249
246
|
async def raw_data(
|
250
|
-
self, *,
|
247
|
+
self, *, asset_id: str, request_options: typing.Optional[RequestOptions] = None
|
251
248
|
) -> typing.AsyncIterator[bytes]:
|
252
249
|
"""
|
253
250
|
Get the raw file data for given asset.
|
254
251
|
|
255
252
|
Parameters
|
256
253
|
----------
|
257
|
-
|
254
|
+
asset_id : str
|
258
255
|
|
259
256
|
request_options : typing.Optional[RequestOptions]
|
260
257
|
Request-specific configuration.
|
@@ -272,14 +269,11 @@ class AsyncToolsClient:
|
|
272
269
|
api_key="YOUR_API_KEY",
|
273
270
|
)
|
274
271
|
await client.tools.raw_data(
|
275
|
-
|
272
|
+
asset_id="string",
|
276
273
|
)
|
277
274
|
"""
|
278
275
|
async with self._client_wrapper.httpx_client.stream(
|
279
|
-
"api/v0/tools/file/raw-data",
|
280
|
-
method="GET",
|
281
|
-
params={"document_id": document_id},
|
282
|
-
request_options=request_options,
|
276
|
+
"api/v0/tools/file/raw-data", method="GET", params={"asset_id": asset_id}, request_options=request_options
|
283
277
|
) as _response:
|
284
278
|
if 200 <= _response.status_code < 300:
|
285
279
|
async for _chunk in _response.aiter_bytes():
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/jsonable_encoder.py
RENAMED
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/pydantic_utilities.py
RENAMED
File without changes
|
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/remove_none_from_dict.py
RENAMED
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/core/request_options.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/errors/internal_server_error.py
RENAMED
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/errors/not_found_error.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/tools/types/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/data_frame_request_out.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/file_fetch_error.py
RENAMED
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/http_validation_error.py
RENAMED
File without changes
|
{athena_intelligence-0.1.98 → athena_intelligence-0.1.99}/src/athena/types/validation_error.py
RENAMED
File without changes
|
File without changes
|
File without changes
|