athena-intelligence 0.1.202__py3-none-any.whl → 0.1.203__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.
athena/__init__.py CHANGED
@@ -32,6 +32,7 @@ from .types import (
32
32
  GeneralAgentResponse,
33
33
  GeneralAgentResponseMessage,
34
34
  GeneralAgentResponseMessageKwargs,
35
+ GetTableResponse,
35
36
  Id,
36
37
  ImageUrlContent,
37
38
  InputMessage,
@@ -101,6 +102,7 @@ __all__ = [
101
102
  "GeneralAgentResponse",
102
103
  "GeneralAgentResponseMessage",
103
104
  "GeneralAgentResponseMessageKwargs",
105
+ "GetTableResponse",
104
106
  "Id",
105
107
  "ImageUrlContent",
106
108
  "InputMessage",
@@ -22,10 +22,10 @@ class BaseClientWrapper:
22
22
 
23
23
  def get_headers(self) -> typing.Dict[str, str]:
24
24
  headers: typing.Dict[str, str] = {
25
- "User-Agent": "athena-intelligence/0.1.202",
25
+ "User-Agent": "athena-intelligence/0.1.203",
26
26
  "X-Fern-Language": "Python",
27
27
  "X-Fern-SDK-Name": "athena-intelligence",
28
- "X-Fern-SDK-Version": "0.1.202",
28
+ "X-Fern-SDK-Version": "0.1.203",
29
29
  **(self.get_custom_headers() or {}),
30
30
  }
31
31
  headers["X-API-KEY"] = self.api_key
@@ -5,6 +5,7 @@ import typing
5
5
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ...core.request_options import RequestOptions
7
7
  from ...types.create_new_sheet_tab_response import CreateNewSheetTabResponse
8
+ from ...types.get_table_response import GetTableResponse
8
9
  from ...types.sheet_operation_response import SheetOperationResponse
9
10
  from .raw_client import AsyncRawSheetsClient, RawSheetsClient
10
11
 
@@ -883,6 +884,52 @@ class SheetsClient:
883
884
  )
884
885
  return _response.data
885
886
 
887
+ def get_table(
888
+ self,
889
+ *,
890
+ asset_id: str,
891
+ table_id: typing.Optional[str] = OMIT,
892
+ table_name: typing.Optional[str] = OMIT,
893
+ request_options: typing.Optional[RequestOptions] = None,
894
+ ) -> GetTableResponse:
895
+ """
896
+ Retrieve table data from an Athena spreadsheet.
897
+
898
+ Parameters
899
+ ----------
900
+ asset_id : str
901
+ The ID of the spreadsheet asset
902
+
903
+ table_id : typing.Optional[str]
904
+ Table ID to retrieve
905
+
906
+ table_name : typing.Optional[str]
907
+ Table name to retrieve
908
+
909
+ request_options : typing.Optional[RequestOptions]
910
+ Request-specific configuration.
911
+
912
+ Returns
913
+ -------
914
+ GetTableResponse
915
+ Successful Response
916
+
917
+ Examples
918
+ --------
919
+ from athena import Athena
920
+
921
+ client = Athena(
922
+ api_key="YOUR_API_KEY",
923
+ )
924
+ client.tools.sheets.get_table(
925
+ asset_id="asset_id",
926
+ )
927
+ """
928
+ _response = self._raw_client.get_table(
929
+ asset_id=asset_id, table_id=table_id, table_name=table_name, request_options=request_options
930
+ )
931
+ return _response.data
932
+
886
933
  def update_table(
887
934
  self,
888
935
  *,
@@ -1947,6 +1994,60 @@ class AsyncSheetsClient:
1947
1994
  )
1948
1995
  return _response.data
1949
1996
 
1997
+ async def get_table(
1998
+ self,
1999
+ *,
2000
+ asset_id: str,
2001
+ table_id: typing.Optional[str] = OMIT,
2002
+ table_name: typing.Optional[str] = OMIT,
2003
+ request_options: typing.Optional[RequestOptions] = None,
2004
+ ) -> GetTableResponse:
2005
+ """
2006
+ Retrieve table data from an Athena spreadsheet.
2007
+
2008
+ Parameters
2009
+ ----------
2010
+ asset_id : str
2011
+ The ID of the spreadsheet asset
2012
+
2013
+ table_id : typing.Optional[str]
2014
+ Table ID to retrieve
2015
+
2016
+ table_name : typing.Optional[str]
2017
+ Table name to retrieve
2018
+
2019
+ request_options : typing.Optional[RequestOptions]
2020
+ Request-specific configuration.
2021
+
2022
+ Returns
2023
+ -------
2024
+ GetTableResponse
2025
+ Successful Response
2026
+
2027
+ Examples
2028
+ --------
2029
+ import asyncio
2030
+
2031
+ from athena import AsyncAthena
2032
+
2033
+ client = AsyncAthena(
2034
+ api_key="YOUR_API_KEY",
2035
+ )
2036
+
2037
+
2038
+ async def main() -> None:
2039
+ await client.tools.sheets.get_table(
2040
+ asset_id="asset_id",
2041
+ )
2042
+
2043
+
2044
+ asyncio.run(main())
2045
+ """
2046
+ _response = await self._raw_client.get_table(
2047
+ asset_id=asset_id, table_id=table_id, table_name=table_name, request_options=request_options
2048
+ )
2049
+ return _response.data
2050
+
1950
2051
  async def update_table(
1951
2052
  self,
1952
2053
  *,
@@ -10,6 +10,7 @@ from ...core.pydantic_utilities import parse_obj_as
10
10
  from ...core.request_options import RequestOptions
11
11
  from ...errors.unprocessable_entity_error import UnprocessableEntityError
12
12
  from ...types.create_new_sheet_tab_response import CreateNewSheetTabResponse
13
+ from ...types.get_table_response import GetTableResponse
13
14
  from ...types.sheet_operation_response import SheetOperationResponse
14
15
 
15
16
  # this is used as the default value for optional parameters
@@ -1140,6 +1141,76 @@ class RawSheetsClient:
1140
1141
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1141
1142
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1142
1143
 
1144
+ def get_table(
1145
+ self,
1146
+ *,
1147
+ asset_id: str,
1148
+ table_id: typing.Optional[str] = OMIT,
1149
+ table_name: typing.Optional[str] = OMIT,
1150
+ request_options: typing.Optional[RequestOptions] = None,
1151
+ ) -> HttpResponse[GetTableResponse]:
1152
+ """
1153
+ Retrieve table data from an Athena spreadsheet.
1154
+
1155
+ Parameters
1156
+ ----------
1157
+ asset_id : str
1158
+ The ID of the spreadsheet asset
1159
+
1160
+ table_id : typing.Optional[str]
1161
+ Table ID to retrieve
1162
+
1163
+ table_name : typing.Optional[str]
1164
+ Table name to retrieve
1165
+
1166
+ request_options : typing.Optional[RequestOptions]
1167
+ Request-specific configuration.
1168
+
1169
+ Returns
1170
+ -------
1171
+ HttpResponse[GetTableResponse]
1172
+ Successful Response
1173
+ """
1174
+ _response = self._client_wrapper.httpx_client.request(
1175
+ "api/v0/tools/sheets/table/get",
1176
+ method="POST",
1177
+ json={
1178
+ "asset_id": asset_id,
1179
+ "table_id": table_id,
1180
+ "table_name": table_name,
1181
+ },
1182
+ headers={
1183
+ "content-type": "application/json",
1184
+ },
1185
+ request_options=request_options,
1186
+ omit=OMIT,
1187
+ )
1188
+ try:
1189
+ if 200 <= _response.status_code < 300:
1190
+ _data = typing.cast(
1191
+ GetTableResponse,
1192
+ parse_obj_as(
1193
+ type_=GetTableResponse, # type: ignore
1194
+ object_=_response.json(),
1195
+ ),
1196
+ )
1197
+ return HttpResponse(response=_response, data=_data)
1198
+ if _response.status_code == 422:
1199
+ raise UnprocessableEntityError(
1200
+ headers=dict(_response.headers),
1201
+ body=typing.cast(
1202
+ typing.Optional[typing.Any],
1203
+ parse_obj_as(
1204
+ type_=typing.Optional[typing.Any], # type: ignore
1205
+ object_=_response.json(),
1206
+ ),
1207
+ ),
1208
+ )
1209
+ _response_json = _response.json()
1210
+ except JSONDecodeError:
1211
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1212
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1213
+
1143
1214
  def update_table(
1144
1215
  self,
1145
1216
  *,
@@ -2360,6 +2431,76 @@ class AsyncRawSheetsClient:
2360
2431
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2361
2432
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2362
2433
 
2434
+ async def get_table(
2435
+ self,
2436
+ *,
2437
+ asset_id: str,
2438
+ table_id: typing.Optional[str] = OMIT,
2439
+ table_name: typing.Optional[str] = OMIT,
2440
+ request_options: typing.Optional[RequestOptions] = None,
2441
+ ) -> AsyncHttpResponse[GetTableResponse]:
2442
+ """
2443
+ Retrieve table data from an Athena spreadsheet.
2444
+
2445
+ Parameters
2446
+ ----------
2447
+ asset_id : str
2448
+ The ID of the spreadsheet asset
2449
+
2450
+ table_id : typing.Optional[str]
2451
+ Table ID to retrieve
2452
+
2453
+ table_name : typing.Optional[str]
2454
+ Table name to retrieve
2455
+
2456
+ request_options : typing.Optional[RequestOptions]
2457
+ Request-specific configuration.
2458
+
2459
+ Returns
2460
+ -------
2461
+ AsyncHttpResponse[GetTableResponse]
2462
+ Successful Response
2463
+ """
2464
+ _response = await self._client_wrapper.httpx_client.request(
2465
+ "api/v0/tools/sheets/table/get",
2466
+ method="POST",
2467
+ json={
2468
+ "asset_id": asset_id,
2469
+ "table_id": table_id,
2470
+ "table_name": table_name,
2471
+ },
2472
+ headers={
2473
+ "content-type": "application/json",
2474
+ },
2475
+ request_options=request_options,
2476
+ omit=OMIT,
2477
+ )
2478
+ try:
2479
+ if 200 <= _response.status_code < 300:
2480
+ _data = typing.cast(
2481
+ GetTableResponse,
2482
+ parse_obj_as(
2483
+ type_=GetTableResponse, # type: ignore
2484
+ object_=_response.json(),
2485
+ ),
2486
+ )
2487
+ return AsyncHttpResponse(response=_response, data=_data)
2488
+ if _response.status_code == 422:
2489
+ raise UnprocessableEntityError(
2490
+ headers=dict(_response.headers),
2491
+ body=typing.cast(
2492
+ typing.Optional[typing.Any],
2493
+ parse_obj_as(
2494
+ type_=typing.Optional[typing.Any], # type: ignore
2495
+ object_=_response.json(),
2496
+ ),
2497
+ ),
2498
+ )
2499
+ _response_json = _response.json()
2500
+ except JSONDecodeError:
2501
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2502
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2503
+
2363
2504
  async def update_table(
2364
2505
  self,
2365
2506
  *,
athena/types/__init__.py CHANGED
@@ -29,6 +29,7 @@ from .general_agent_request import GeneralAgentRequest
29
29
  from .general_agent_response import GeneralAgentResponse
30
30
  from .general_agent_response_message import GeneralAgentResponseMessage
31
31
  from .general_agent_response_message_kwargs import GeneralAgentResponseMessageKwargs
32
+ from .get_table_response import GetTableResponse
32
33
  from .id import Id
33
34
  from .image_url_content import ImageUrlContent
34
35
  from .input_message import InputMessage
@@ -79,6 +80,7 @@ __all__ = [
79
80
  "GeneralAgentResponse",
80
81
  "GeneralAgentResponseMessage",
81
82
  "GeneralAgentResponseMessageKwargs",
83
+ "GetTableResponse",
82
84
  "Id",
83
85
  "ImageUrlContent",
84
86
  "InputMessage",
@@ -0,0 +1,37 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class GetTableResponse(UniversalBaseModel):
10
+ asset_id: str = pydantic.Field()
11
+ """
12
+ The ID of the spreadsheet asset
13
+ """
14
+
15
+ data: typing.List[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field()
16
+ """
17
+ Array of row objects with column names as keys
18
+ """
19
+
20
+ message: str = pydantic.Field()
21
+ """
22
+ Success message or error description
23
+ """
24
+
25
+ success: bool = pydantic.Field()
26
+ """
27
+ Whether the operation was successful
28
+ """
29
+
30
+ if IS_PYDANTIC_V2:
31
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
32
+ else:
33
+
34
+ class Config:
35
+ frozen = True
36
+ smart_union = True
37
+ extra = pydantic.Extra.allow
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: athena-intelligence
3
- Version: 0.1.202
3
+ Version: 0.1.203
4
4
  Summary: Athena Intelligence Python Library
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -1,4 +1,4 @@
1
- athena/__init__.py,sha256=Z5VOxDLNVeRpmNJz19W7I1YXlgSDE5fXkLb5UBl7QBQ,3409
1
+ athena/__init__.py,sha256=nQ-oM62OoQr7TrcL7YqLGCieFFxYmw0Dbf5dFORbyhI,3455
2
2
  athena/agents/__init__.py,sha256=dg7IOwE6-BQSx20JEhdc1VDHlbIHPy08x5fuww_Tvko,180
3
3
  athena/agents/client.py,sha256=A70jdG6spqLkPriU8-NCn0vOJvdc5f4SKoVZLOebZjQ,5975
4
4
  athena/agents/drive/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
@@ -21,7 +21,7 @@ athena/base_client.py,sha256=dWl0sEjfhGQ_Jj_wq0ypDrGnOoi1s5YwCXinP6Qnyjk,6336
21
21
  athena/client.py,sha256=lK3vVU3TF3YjPpiohpxcuRl8x_sSw8HmQ-uuDDeAT6I,22161
22
22
  athena/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
23
23
  athena/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
24
- athena/core/client_wrapper.py,sha256=SlHIUqPWwBdggDUEFehVAu6se1IPHTkSMe-G6CZRhVc,2392
24
+ athena/core/client_wrapper.py,sha256=ncxABrvUNAyODlc4ybw9Oo3AGD-s3RhDojHTAUh609s,2392
25
25
  athena/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
26
26
  athena/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
27
27
  athena/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
@@ -58,8 +58,8 @@ athena/tools/email/client.py,sha256=dOidOOOLHdfz2c3nykzyOa7nTftS91d2_aws0LTg8DU,
58
58
  athena/tools/email/raw_client.py,sha256=GkSxb-RFdhGgFNghnwH6i0cPI_gfWGLUmWvBNlBlhE4,9962
59
59
  athena/tools/raw_client.py,sha256=gUwmZV08uBGmTTNoWFuYGPMnFxPEhswKPDEbLIcVHPo,53027
60
60
  athena/tools/sheets/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
61
- athena/tools/sheets/client.py,sha256=FeZDM-grtK34oiH0_60fggD1bo9ddojDwr1n58vBnHA,52680
62
- athena/tools/sheets/raw_client.py,sha256=l2P7Iv-V_AEMLkXnzrOvkwZYQRyY6VGkjNicW3S5ST4,84972
61
+ athena/tools/sheets/client.py,sha256=PFN_qTfL2sNXkSyU8rDbwEqrHW1ACI9hVkGdfzbDdOE,55273
62
+ athena/tools/sheets/raw_client.py,sha256=bi2koBw2Ggct_9ZWZ3kRS50a9sVbT-ZWVtpU9XfMS9k,89950
63
63
  athena/tools/structured_data_extractor/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
64
64
  athena/tools/structured_data_extractor/client.py,sha256=V1FcGZTPbrlz2d9oQZhsj3UIN1ZlZfnqRdDXj16xiPs,10623
65
65
  athena/tools/structured_data_extractor/raw_client.py,sha256=1ZYZBssmf1jDomopeJ3PMRLql3zT4c7ssRNNLa1YrGE,11245
@@ -68,7 +68,7 @@ athena/tools/tasks/client.py,sha256=c_YZ7OjQNJmPKbeeXJznXj3zo5CRFSv02dLupAdHAyo,
68
68
  athena/tools/tasks/raw_client.py,sha256=Mexzuf_HcRXWNlESDGQkHHv5tC2tAo-AX3PBSuSRO3U,3812
69
69
  athena/tools/types/__init__.py,sha256=ZI6REilQ0Xuocjd8iyNVfLvOsA2Ltlb8--px07wRSPg,217
70
70
  athena/tools/types/tools_data_frame_request_columns_item.py,sha256=GA1FUlTV_CfSc-KToTAwFf4Exl0rr4fsweVZupztjw0,138
71
- athena/types/__init__.py,sha256=TH-zHkr7p_GvtBIbuGBGQPSv71jwsooaaLzczFfVas4,3777
71
+ athena/types/__init__.py,sha256=yxNEamC14ufn5CUS3y57Qda5qvauEEXEKEY9LruwSDo,3850
72
72
  athena/types/asset_content_request_out.py,sha256=RYlcY6j6Ju5EQL7UquDwyTe7uqxyuO8Bg8LCsv1YiUE,652
73
73
  athena/types/asset_node.py,sha256=3l7CUK2c_h4QT8ktSq0rFP9veF9G_V9mNe3NZlGl-xQ,804
74
74
  athena/types/asset_not_found_error.py,sha256=lIQpdTXCgbXRs21XCMhd_kB7fR6Y6Ep112mK4rejNx0,528
@@ -96,6 +96,7 @@ athena/types/general_agent_request.py,sha256=ltPew4FLKx795M9ktnsWbArLJHqTqhpP-R4
96
96
  athena/types/general_agent_response.py,sha256=G5LYQnZJeFdU3COK9Syyuk8rGvRYd1F_NeiDiu1zIFg,690
97
97
  athena/types/general_agent_response_message.py,sha256=P9JpetwgY2z_iSjFbiLZwuSv2Ez7g_hDvRkQo-31Gok,3071
98
98
  athena/types/general_agent_response_message_kwargs.py,sha256=XWMwp6WLAPiArBKU7NuuebTkq0jM8QVlTVfEfoldJOk,2170
99
+ athena/types/get_table_response.py,sha256=vO2W6_rkFrbr3ykA10bB0fJBCprteyai5lNHbbhSyS4,943
99
100
  athena/types/id.py,sha256=6fnF__LI2KYyDjZwbs8y5sik8HoYPMRF7Ljihn1MBYY,121
100
101
  athena/types/image_url_content.py,sha256=SIlScFxuyfXpSU-xMLypitQK5gu_6ITjZYt64Dq9RYQ,589
101
102
  athena/types/input_message.py,sha256=MwgLCWH9mfUM5NFEV_AVjhS12ruNOxZxSXLcYKQ0rww,854
@@ -112,6 +113,6 @@ athena/types/structured_data_extractor_response.py,sha256=yFQ0CiFDdlZIq2X8UprEAw
112
113
  athena/types/text_content.py,sha256=tcVCPj3tHh5zQcTElr2tdCIjjfx3ZI63rKIlaG8vo64,592
113
114
  athena/types/type.py,sha256=Gvs56nvBMPcQpOZkfPocGNNb7S05PuINianbT309QAQ,146
114
115
  athena/version.py,sha256=tnXYUugs9zF_pkVdem-QBorKSuhEOOuetkR57dADDxE,86
115
- athena_intelligence-0.1.202.dist-info/METADATA,sha256=IGQbQdAlTge-fog01SloSBkJRd6zshGxowApC9ypG8A,5440
116
- athena_intelligence-0.1.202.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
117
- athena_intelligence-0.1.202.dist-info/RECORD,,
116
+ athena_intelligence-0.1.203.dist-info/METADATA,sha256=DYlLNE2F5bhceg8hu9GNhoGAeT4wYUx4WAOMJfRhA-4,5440
117
+ athena_intelligence-0.1.203.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
118
+ athena_intelligence-0.1.203.dist-info/RECORD,,