athena-intelligence 0.1.230__py3-none-any.whl → 0.1.242__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.
Potentially problematic release.
This version of athena-intelligence might be problematic. Click here for more details.
- athena/__init__.py +217 -68
- athena/agents/__init__.py +33 -1
- athena/agents/client.py +81 -18
- athena/assets/client.py +12 -2
- athena/base_client.py +118 -18
- athena/client.py +14 -8
- athena/core/__init__.py +73 -20
- athena/core/client_wrapper.py +2 -2
- athena/core/force_multipart.py +4 -2
- athena/core/http_response.py +1 -1
- athena/core/pydantic_utilities.py +5 -2
- athena/errors/__init__.py +42 -7
- athena/query/__init__.py +28 -1
- athena/query/types/__init__.py +30 -1
- athena/tools/__init__.py +47 -3
- athena/tools/client.py +157 -26
- athena/tools/sheets/__init__.py +30 -0
- athena/tools/sheets/client.py +59 -94
- athena/tools/sheets/raw_client.py +60 -74
- athena/tools/sheets/types/__init__.py +36 -0
- athena/tools/sheets/types/update_sheet_range_request_values_item_item.py +5 -0
- athena/tools/types/__init__.py +28 -1
- athena/types/__init__.py +181 -51
- athena/types/aop_execute_response_out.py +2 -1
- athena/types/backgroundcolor.py +7 -0
- athena/types/border_model.py +23 -0
- athena/types/border_style.py +7 -0
- athena/types/borders_model.py +23 -0
- athena/types/cell_format.py +49 -0
- athena/types/cell_format_horizontal_alignment.py +5 -0
- athena/types/cell_format_vertical_alignment.py +5 -0
- athena/types/color.py +7 -0
- athena/types/conversation_asset_info.py +3 -2
- athena/types/conversation_message.py +42 -0
- athena/types/conversation_result.py +67 -0
- athena/types/number_format_model.py +28 -0
- athena/types/number_format_type.py +21 -0
- athena/types/sheet.py +53 -0
- athena/types/text_format_model.py +28 -0
- athena/types/textrotation.py +5 -0
- athena/types/theme_color.py +20 -0
- athena/types/wrap_strategy.py +5 -0
- {athena_intelligence-0.1.230.dist-info → athena_intelligence-0.1.242.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.230.dist-info → athena_intelligence-0.1.242.dist-info}/RECORD +45 -26
- {athena_intelligence-0.1.230.dist-info → athena_intelligence-0.1.242.dist-info}/WHEEL +0 -0
athena/tools/client.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
import typing
|
|
4
6
|
|
|
5
7
|
from .. import core
|
|
@@ -11,14 +13,15 @@ from ..types.data_frame_request_out import DataFrameRequestOut
|
|
|
11
13
|
from ..types.file_chunk_request_out import FileChunkRequestOut
|
|
12
14
|
from ..types.folder_response import FolderResponse
|
|
13
15
|
from ..types.save_asset_request_out import SaveAssetRequestOut
|
|
14
|
-
from .calendar.client import AsyncCalendarClient, CalendarClient
|
|
15
|
-
from .email.client import AsyncEmailClient, EmailClient
|
|
16
16
|
from .raw_client import AsyncRawToolsClient, RawToolsClient
|
|
17
|
-
from .sheets.client import AsyncSheetsClient, SheetsClient
|
|
18
|
-
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient, StructuredDataExtractorClient
|
|
19
|
-
from .tasks.client import AsyncTasksClient, TasksClient
|
|
20
17
|
from .types.tools_data_frame_request_columns_item import ToolsDataFrameRequestColumnsItem
|
|
21
18
|
|
|
19
|
+
if typing.TYPE_CHECKING:
|
|
20
|
+
from .calendar.client import AsyncCalendarClient, CalendarClient
|
|
21
|
+
from .email.client import AsyncEmailClient, EmailClient
|
|
22
|
+
from .sheets.client import AsyncSheetsClient, SheetsClient
|
|
23
|
+
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient, StructuredDataExtractorClient
|
|
24
|
+
from .tasks.client import AsyncTasksClient, TasksClient
|
|
22
25
|
# this is used as the default value for optional parameters
|
|
23
26
|
OMIT = typing.cast(typing.Any, ...)
|
|
24
27
|
|
|
@@ -26,15 +29,12 @@ OMIT = typing.cast(typing.Any, ...)
|
|
|
26
29
|
class ToolsClient:
|
|
27
30
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
28
31
|
self._raw_client = RawToolsClient(client_wrapper=client_wrapper)
|
|
29
|
-
self.
|
|
30
|
-
|
|
31
|
-
self.
|
|
32
|
-
|
|
33
|
-
self.
|
|
34
|
-
|
|
35
|
-
self.structured_data_extractor = StructuredDataExtractorClient(client_wrapper=client_wrapper)
|
|
36
|
-
|
|
37
|
-
self.tasks = TasksClient(client_wrapper=client_wrapper)
|
|
32
|
+
self._client_wrapper = client_wrapper
|
|
33
|
+
self._calendar: typing.Optional[CalendarClient] = None
|
|
34
|
+
self._email: typing.Optional[EmailClient] = None
|
|
35
|
+
self._sheets: typing.Optional[SheetsClient] = None
|
|
36
|
+
self._structured_data_extractor: typing.Optional[StructuredDataExtractorClient] = None
|
|
37
|
+
self._tasks: typing.Optional[TasksClient] = None
|
|
38
38
|
|
|
39
39
|
@property
|
|
40
40
|
def with_raw_response(self) -> RawToolsClient:
|
|
@@ -148,6 +148,7 @@ class ToolsClient:
|
|
|
148
148
|
)
|
|
149
149
|
client.tools.get_asset_screenshot(
|
|
150
150
|
asset_id="asset_id",
|
|
151
|
+
page_number=1,
|
|
151
152
|
)
|
|
152
153
|
"""
|
|
153
154
|
_response = self._raw_client.get_asset_screenshot(
|
|
@@ -192,7 +193,12 @@ class ToolsClient:
|
|
|
192
193
|
client = Athena(
|
|
193
194
|
api_key="YOUR_API_KEY",
|
|
194
195
|
)
|
|
195
|
-
client.tools.list_contents(
|
|
196
|
+
client.tools.list_contents(
|
|
197
|
+
asset_id="asset_id",
|
|
198
|
+
folder_id="folder_id",
|
|
199
|
+
include_asset_details=True,
|
|
200
|
+
include_system_files=True,
|
|
201
|
+
)
|
|
196
202
|
"""
|
|
197
203
|
_response = self._raw_client.list_contents(
|
|
198
204
|
asset_id=asset_id,
|
|
@@ -251,6 +257,10 @@ class ToolsClient:
|
|
|
251
257
|
)
|
|
252
258
|
client.tools.data_frame(
|
|
253
259
|
asset_id="asset_id",
|
|
260
|
+
row_limit=1,
|
|
261
|
+
index_column=1,
|
|
262
|
+
sheet_name="sheet_name",
|
|
263
|
+
separator="separator",
|
|
254
264
|
)
|
|
255
265
|
"""
|
|
256
266
|
_response = self._raw_client.data_frame(
|
|
@@ -281,6 +291,17 @@ class ToolsClient:
|
|
|
281
291
|
-------
|
|
282
292
|
typing.Iterator[bytes]
|
|
283
293
|
Stream the file in original format.
|
|
294
|
+
|
|
295
|
+
Examples
|
|
296
|
+
--------
|
|
297
|
+
from athena import Athena
|
|
298
|
+
|
|
299
|
+
client = Athena(
|
|
300
|
+
api_key="YOUR_API_KEY",
|
|
301
|
+
)
|
|
302
|
+
client.tools.raw_data(
|
|
303
|
+
asset_id="asset_id",
|
|
304
|
+
)
|
|
284
305
|
"""
|
|
285
306
|
with self._raw_client.raw_data(asset_id=asset_id, request_options=request_options) as r:
|
|
286
307
|
yield from r.data
|
|
@@ -316,26 +337,65 @@ class ToolsClient:
|
|
|
316
337
|
client = Athena(
|
|
317
338
|
api_key="YOUR_API_KEY",
|
|
318
339
|
)
|
|
319
|
-
client.tools.save_asset(
|
|
340
|
+
client.tools.save_asset(
|
|
341
|
+
parent_folder_id="parent_folder_id",
|
|
342
|
+
)
|
|
320
343
|
"""
|
|
321
344
|
_response = self._raw_client.save_asset(
|
|
322
345
|
file=file, parent_folder_id=parent_folder_id, request_options=request_options
|
|
323
346
|
)
|
|
324
347
|
return _response.data
|
|
325
348
|
|
|
349
|
+
@property
|
|
350
|
+
def calendar(self):
|
|
351
|
+
if self._calendar is None:
|
|
352
|
+
from .calendar.client import CalendarClient # noqa: E402
|
|
326
353
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
354
|
+
self._calendar = CalendarClient(client_wrapper=self._client_wrapper)
|
|
355
|
+
return self._calendar
|
|
356
|
+
|
|
357
|
+
@property
|
|
358
|
+
def email(self):
|
|
359
|
+
if self._email is None:
|
|
360
|
+
from .email.client import EmailClient # noqa: E402
|
|
361
|
+
|
|
362
|
+
self._email = EmailClient(client_wrapper=self._client_wrapper)
|
|
363
|
+
return self._email
|
|
364
|
+
|
|
365
|
+
@property
|
|
366
|
+
def sheets(self):
|
|
367
|
+
if self._sheets is None:
|
|
368
|
+
from .sheets.client import SheetsClient # noqa: E402
|
|
331
369
|
|
|
332
|
-
|
|
370
|
+
self._sheets = SheetsClient(client_wrapper=self._client_wrapper)
|
|
371
|
+
return self._sheets
|
|
333
372
|
|
|
334
|
-
|
|
373
|
+
@property
|
|
374
|
+
def structured_data_extractor(self):
|
|
375
|
+
if self._structured_data_extractor is None:
|
|
376
|
+
from .structured_data_extractor.client import StructuredDataExtractorClient # noqa: E402
|
|
377
|
+
|
|
378
|
+
self._structured_data_extractor = StructuredDataExtractorClient(client_wrapper=self._client_wrapper)
|
|
379
|
+
return self._structured_data_extractor
|
|
335
380
|
|
|
336
|
-
|
|
381
|
+
@property
|
|
382
|
+
def tasks(self):
|
|
383
|
+
if self._tasks is None:
|
|
384
|
+
from .tasks.client import TasksClient # noqa: E402
|
|
337
385
|
|
|
338
|
-
|
|
386
|
+
self._tasks = TasksClient(client_wrapper=self._client_wrapper)
|
|
387
|
+
return self._tasks
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
class AsyncToolsClient:
|
|
391
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
392
|
+
self._raw_client = AsyncRawToolsClient(client_wrapper=client_wrapper)
|
|
393
|
+
self._client_wrapper = client_wrapper
|
|
394
|
+
self._calendar: typing.Optional[AsyncCalendarClient] = None
|
|
395
|
+
self._email: typing.Optional[AsyncEmailClient] = None
|
|
396
|
+
self._sheets: typing.Optional[AsyncSheetsClient] = None
|
|
397
|
+
self._structured_data_extractor: typing.Optional[AsyncStructuredDataExtractorClient] = None
|
|
398
|
+
self._tasks: typing.Optional[AsyncTasksClient] = None
|
|
339
399
|
|
|
340
400
|
@property
|
|
341
401
|
def with_raw_response(self) -> AsyncRawToolsClient:
|
|
@@ -470,6 +530,7 @@ class AsyncToolsClient:
|
|
|
470
530
|
async def main() -> None:
|
|
471
531
|
await client.tools.get_asset_screenshot(
|
|
472
532
|
asset_id="asset_id",
|
|
533
|
+
page_number=1,
|
|
473
534
|
)
|
|
474
535
|
|
|
475
536
|
|
|
@@ -522,7 +583,12 @@ class AsyncToolsClient:
|
|
|
522
583
|
|
|
523
584
|
|
|
524
585
|
async def main() -> None:
|
|
525
|
-
await client.tools.list_contents(
|
|
586
|
+
await client.tools.list_contents(
|
|
587
|
+
asset_id="asset_id",
|
|
588
|
+
folder_id="folder_id",
|
|
589
|
+
include_asset_details=True,
|
|
590
|
+
include_system_files=True,
|
|
591
|
+
)
|
|
526
592
|
|
|
527
593
|
|
|
528
594
|
asyncio.run(main())
|
|
@@ -589,6 +655,10 @@ class AsyncToolsClient:
|
|
|
589
655
|
async def main() -> None:
|
|
590
656
|
await client.tools.data_frame(
|
|
591
657
|
asset_id="asset_id",
|
|
658
|
+
row_limit=1,
|
|
659
|
+
index_column=1,
|
|
660
|
+
sheet_name="sheet_name",
|
|
661
|
+
separator="separator",
|
|
592
662
|
)
|
|
593
663
|
|
|
594
664
|
|
|
@@ -622,6 +692,25 @@ class AsyncToolsClient:
|
|
|
622
692
|
-------
|
|
623
693
|
typing.AsyncIterator[bytes]
|
|
624
694
|
Stream the file in original format.
|
|
695
|
+
|
|
696
|
+
Examples
|
|
697
|
+
--------
|
|
698
|
+
import asyncio
|
|
699
|
+
|
|
700
|
+
from athena import AsyncAthena
|
|
701
|
+
|
|
702
|
+
client = AsyncAthena(
|
|
703
|
+
api_key="YOUR_API_KEY",
|
|
704
|
+
)
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
async def main() -> None:
|
|
708
|
+
await client.tools.raw_data(
|
|
709
|
+
asset_id="asset_id",
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
asyncio.run(main())
|
|
625
714
|
"""
|
|
626
715
|
async with self._raw_client.raw_data(asset_id=asset_id, request_options=request_options) as r:
|
|
627
716
|
async for _chunk in r.data:
|
|
@@ -663,7 +752,9 @@ class AsyncToolsClient:
|
|
|
663
752
|
|
|
664
753
|
|
|
665
754
|
async def main() -> None:
|
|
666
|
-
await client.tools.save_asset(
|
|
755
|
+
await client.tools.save_asset(
|
|
756
|
+
parent_folder_id="parent_folder_id",
|
|
757
|
+
)
|
|
667
758
|
|
|
668
759
|
|
|
669
760
|
asyncio.run(main())
|
|
@@ -672,3 +763,43 @@ class AsyncToolsClient:
|
|
|
672
763
|
file=file, parent_folder_id=parent_folder_id, request_options=request_options
|
|
673
764
|
)
|
|
674
765
|
return _response.data
|
|
766
|
+
|
|
767
|
+
@property
|
|
768
|
+
def calendar(self):
|
|
769
|
+
if self._calendar is None:
|
|
770
|
+
from .calendar.client import AsyncCalendarClient # noqa: E402
|
|
771
|
+
|
|
772
|
+
self._calendar = AsyncCalendarClient(client_wrapper=self._client_wrapper)
|
|
773
|
+
return self._calendar
|
|
774
|
+
|
|
775
|
+
@property
|
|
776
|
+
def email(self):
|
|
777
|
+
if self._email is None:
|
|
778
|
+
from .email.client import AsyncEmailClient # noqa: E402
|
|
779
|
+
|
|
780
|
+
self._email = AsyncEmailClient(client_wrapper=self._client_wrapper)
|
|
781
|
+
return self._email
|
|
782
|
+
|
|
783
|
+
@property
|
|
784
|
+
def sheets(self):
|
|
785
|
+
if self._sheets is None:
|
|
786
|
+
from .sheets.client import AsyncSheetsClient # noqa: E402
|
|
787
|
+
|
|
788
|
+
self._sheets = AsyncSheetsClient(client_wrapper=self._client_wrapper)
|
|
789
|
+
return self._sheets
|
|
790
|
+
|
|
791
|
+
@property
|
|
792
|
+
def structured_data_extractor(self):
|
|
793
|
+
if self._structured_data_extractor is None:
|
|
794
|
+
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient # noqa: E402
|
|
795
|
+
|
|
796
|
+
self._structured_data_extractor = AsyncStructuredDataExtractorClient(client_wrapper=self._client_wrapper)
|
|
797
|
+
return self._structured_data_extractor
|
|
798
|
+
|
|
799
|
+
@property
|
|
800
|
+
def tasks(self):
|
|
801
|
+
if self._tasks is None:
|
|
802
|
+
from .tasks.client import AsyncTasksClient # noqa: E402
|
|
803
|
+
|
|
804
|
+
self._tasks = AsyncTasksClient(client_wrapper=self._client_wrapper)
|
|
805
|
+
return self._tasks
|
athena/tools/sheets/__init__.py
CHANGED
|
@@ -2,3 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import UpdateSheetRangeRequestValuesItemItem
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {"UpdateSheetRangeRequestValuesItemItem": ".types"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
14
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
15
|
+
if module_name is None:
|
|
16
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
17
|
+
try:
|
|
18
|
+
module = import_module(module_name, __package__)
|
|
19
|
+
if module_name == f".{attr_name}":
|
|
20
|
+
return module
|
|
21
|
+
else:
|
|
22
|
+
return getattr(module, attr_name)
|
|
23
|
+
except ImportError as e:
|
|
24
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
25
|
+
except AttributeError as e:
|
|
26
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def __dir__():
|
|
30
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
31
|
+
return sorted(lazy_attrs)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__all__ = ["UpdateSheetRangeRequestValuesItemItem"]
|
athena/tools/sheets/client.py
CHANGED
|
@@ -4,11 +4,14 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
6
|
from ...core.request_options import RequestOptions
|
|
7
|
+
from ...types.cell_format import CellFormat
|
|
7
8
|
from ...types.create_new_sheet_tab_response import CreateNewSheetTabResponse
|
|
8
9
|
from ...types.get_table_response import GetTableResponse
|
|
10
|
+
from ...types.sheet import Sheet
|
|
9
11
|
from ...types.sheet_operation_response import SheetOperationResponse
|
|
10
12
|
from ...types.table_row_data import TableRowData
|
|
11
13
|
from .raw_client import AsyncRawSheetsClient, RawSheetsClient
|
|
14
|
+
from .types.update_sheet_range_request_values_item_item import UpdateSheetRangeRequestValuesItemItem
|
|
12
15
|
|
|
13
16
|
# this is used as the default value for optional parameters
|
|
14
17
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -393,10 +396,9 @@ class SheetsClient:
|
|
|
393
396
|
asset_id: str,
|
|
394
397
|
end_column: int,
|
|
395
398
|
end_row: int,
|
|
399
|
+
formatting: CellFormat,
|
|
396
400
|
start_column: int,
|
|
397
401
|
start_row: int,
|
|
398
|
-
type: str,
|
|
399
|
-
value_json: str,
|
|
400
402
|
sheet_id: typing.Optional[int] = OMIT,
|
|
401
403
|
request_options: typing.Optional[RequestOptions] = None,
|
|
402
404
|
) -> SheetOperationResponse:
|
|
@@ -414,18 +416,15 @@ class SheetsClient:
|
|
|
414
416
|
end_row : int
|
|
415
417
|
1-based ending row index
|
|
416
418
|
|
|
419
|
+
formatting : CellFormat
|
|
420
|
+
Cell format
|
|
421
|
+
|
|
417
422
|
start_column : int
|
|
418
423
|
1-based starting column index
|
|
419
424
|
|
|
420
425
|
start_row : int
|
|
421
426
|
1-based starting row index
|
|
422
427
|
|
|
423
|
-
type : str
|
|
424
|
-
Formatting type (e.g. backgroundColor, textFormat, borders, etc.)
|
|
425
|
-
|
|
426
|
-
value_json : str
|
|
427
|
-
JSON string for value param (e.g. '"#FF0000"' or '{"fontSize":12}')
|
|
428
|
-
|
|
429
428
|
sheet_id : typing.Optional[int]
|
|
430
429
|
Sheet ID (defaults to 1)
|
|
431
430
|
|
|
@@ -439,7 +438,7 @@ class SheetsClient:
|
|
|
439
438
|
|
|
440
439
|
Examples
|
|
441
440
|
--------
|
|
442
|
-
from athena import Athena
|
|
441
|
+
from athena import Athena, CellFormat
|
|
443
442
|
|
|
444
443
|
client = Athena(
|
|
445
444
|
api_key="YOUR_API_KEY",
|
|
@@ -448,20 +447,18 @@ class SheetsClient:
|
|
|
448
447
|
asset_id="asset_id",
|
|
449
448
|
end_column=1,
|
|
450
449
|
end_row=1,
|
|
450
|
+
formatting=CellFormat(),
|
|
451
451
|
start_column=1,
|
|
452
452
|
start_row=1,
|
|
453
|
-
type="type",
|
|
454
|
-
value_json="value_json",
|
|
455
453
|
)
|
|
456
454
|
"""
|
|
457
455
|
_response = self._raw_client.format_range(
|
|
458
456
|
asset_id=asset_id,
|
|
459
457
|
end_column=end_column,
|
|
460
458
|
end_row=end_row,
|
|
459
|
+
formatting=formatting,
|
|
461
460
|
start_column=start_column,
|
|
462
461
|
start_row=start_row,
|
|
463
|
-
type=type,
|
|
464
|
-
value_json=value_json,
|
|
465
462
|
sheet_id=sheet_id,
|
|
466
463
|
request_options=request_options,
|
|
467
464
|
)
|
|
@@ -473,7 +470,8 @@ class SheetsClient:
|
|
|
473
470
|
asset_id: str,
|
|
474
471
|
start_column: int,
|
|
475
472
|
start_row: int,
|
|
476
|
-
values: typing.Sequence[
|
|
473
|
+
values: typing.Sequence[typing.Sequence[typing.Optional[UpdateSheetRangeRequestValuesItemItem]]],
|
|
474
|
+
formatting: typing.Optional[typing.Sequence[typing.Sequence[typing.Optional[CellFormat]]]] = OMIT,
|
|
477
475
|
sheet_id: typing.Optional[int] = OMIT,
|
|
478
476
|
request_options: typing.Optional[RequestOptions] = None,
|
|
479
477
|
) -> SheetOperationResponse:
|
|
@@ -491,8 +489,11 @@ class SheetsClient:
|
|
|
491
489
|
start_row : int
|
|
492
490
|
1-based starting row index
|
|
493
491
|
|
|
494
|
-
values : typing.Sequence[
|
|
495
|
-
|
|
492
|
+
values : typing.Sequence[typing.Sequence[typing.Optional[UpdateSheetRangeRequestValuesItemItem]]]
|
|
493
|
+
2D list of cells for each row
|
|
494
|
+
|
|
495
|
+
formatting : typing.Optional[typing.Sequence[typing.Sequence[typing.Optional[CellFormat]]]]
|
|
496
|
+
Optional 2D list of cell formats matching the structure of values. Each row is a list of CellFormat objects for each cell in that row. Use None for cells without formatting. numberFormat is not required unless user explicity asked to change
|
|
496
497
|
|
|
497
498
|
sheet_id : typing.Optional[int]
|
|
498
499
|
Sheet ID (defaults to 1)
|
|
@@ -516,7 +517,7 @@ class SheetsClient:
|
|
|
516
517
|
asset_id="asset_id",
|
|
517
518
|
start_column=1,
|
|
518
519
|
start_row=1,
|
|
519
|
-
values=[
|
|
520
|
+
values=[[]],
|
|
520
521
|
)
|
|
521
522
|
"""
|
|
522
523
|
_response = self._raw_client.update_range(
|
|
@@ -524,6 +525,7 @@ class SheetsClient:
|
|
|
524
525
|
start_column=start_column,
|
|
525
526
|
start_row=start_row,
|
|
526
527
|
values=values,
|
|
528
|
+
formatting=formatting,
|
|
527
529
|
sheet_id=sheet_id,
|
|
528
530
|
request_options=request_options,
|
|
529
531
|
)
|
|
@@ -631,14 +633,7 @@ class SheetsClient:
|
|
|
631
633
|
return _response.data
|
|
632
634
|
|
|
633
635
|
def create_tab(
|
|
634
|
-
self,
|
|
635
|
-
*,
|
|
636
|
-
asset_id: str,
|
|
637
|
-
sheet_id: int,
|
|
638
|
-
title: str,
|
|
639
|
-
active_sheet_id: typing.Optional[int] = OMIT,
|
|
640
|
-
tab_color: typing.Optional[str] = OMIT,
|
|
641
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
636
|
+
self, *, asset_id: str, sheet: Sheet, request_options: typing.Optional[RequestOptions] = None
|
|
642
637
|
) -> CreateNewSheetTabResponse:
|
|
643
638
|
"""
|
|
644
639
|
Create a new tab in an Athena spreadsheet.
|
|
@@ -648,17 +643,8 @@ class SheetsClient:
|
|
|
648
643
|
asset_id : str
|
|
649
644
|
The ID of the spreadsheet asset
|
|
650
645
|
|
|
651
|
-
|
|
652
|
-
Sheet
|
|
653
|
-
|
|
654
|
-
title : str
|
|
655
|
-
Title of the new tab
|
|
656
|
-
|
|
657
|
-
active_sheet_id : typing.Optional[int]
|
|
658
|
-
Currently active sheet ID
|
|
659
|
-
|
|
660
|
-
tab_color : typing.Optional[str]
|
|
661
|
-
Optional color of the new tab
|
|
646
|
+
sheet : Sheet
|
|
647
|
+
Sheet Specification
|
|
662
648
|
|
|
663
649
|
request_options : typing.Optional[RequestOptions]
|
|
664
650
|
Request-specific configuration.
|
|
@@ -670,25 +656,23 @@ class SheetsClient:
|
|
|
670
656
|
|
|
671
657
|
Examples
|
|
672
658
|
--------
|
|
673
|
-
from athena import Athena
|
|
659
|
+
from athena import Athena, Sheet
|
|
674
660
|
|
|
675
661
|
client = Athena(
|
|
676
662
|
api_key="YOUR_API_KEY",
|
|
677
663
|
)
|
|
678
664
|
client.tools.sheets.create_tab(
|
|
679
665
|
asset_id="asset_id",
|
|
680
|
-
|
|
681
|
-
|
|
666
|
+
sheet=Sheet(
|
|
667
|
+
column_count=1,
|
|
668
|
+
index=1,
|
|
669
|
+
row_count=1,
|
|
670
|
+
sheet_id=1,
|
|
671
|
+
title="title",
|
|
672
|
+
),
|
|
682
673
|
)
|
|
683
674
|
"""
|
|
684
|
-
_response = self._raw_client.create_tab(
|
|
685
|
-
asset_id=asset_id,
|
|
686
|
-
sheet_id=sheet_id,
|
|
687
|
-
title=title,
|
|
688
|
-
active_sheet_id=active_sheet_id,
|
|
689
|
-
tab_color=tab_color,
|
|
690
|
-
request_options=request_options,
|
|
691
|
-
)
|
|
675
|
+
_response = self._raw_client.create_tab(asset_id=asset_id, sheet=sheet, request_options=request_options)
|
|
692
676
|
return _response.data
|
|
693
677
|
|
|
694
678
|
def delete_table_column(
|
|
@@ -1500,10 +1484,9 @@ class AsyncSheetsClient:
|
|
|
1500
1484
|
asset_id: str,
|
|
1501
1485
|
end_column: int,
|
|
1502
1486
|
end_row: int,
|
|
1487
|
+
formatting: CellFormat,
|
|
1503
1488
|
start_column: int,
|
|
1504
1489
|
start_row: int,
|
|
1505
|
-
type: str,
|
|
1506
|
-
value_json: str,
|
|
1507
1490
|
sheet_id: typing.Optional[int] = OMIT,
|
|
1508
1491
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1509
1492
|
) -> SheetOperationResponse:
|
|
@@ -1521,18 +1504,15 @@ class AsyncSheetsClient:
|
|
|
1521
1504
|
end_row : int
|
|
1522
1505
|
1-based ending row index
|
|
1523
1506
|
|
|
1507
|
+
formatting : CellFormat
|
|
1508
|
+
Cell format
|
|
1509
|
+
|
|
1524
1510
|
start_column : int
|
|
1525
1511
|
1-based starting column index
|
|
1526
1512
|
|
|
1527
1513
|
start_row : int
|
|
1528
1514
|
1-based starting row index
|
|
1529
1515
|
|
|
1530
|
-
type : str
|
|
1531
|
-
Formatting type (e.g. backgroundColor, textFormat, borders, etc.)
|
|
1532
|
-
|
|
1533
|
-
value_json : str
|
|
1534
|
-
JSON string for value param (e.g. '"#FF0000"' or '{"fontSize":12}')
|
|
1535
|
-
|
|
1536
1516
|
sheet_id : typing.Optional[int]
|
|
1537
1517
|
Sheet ID (defaults to 1)
|
|
1538
1518
|
|
|
@@ -1548,7 +1528,7 @@ class AsyncSheetsClient:
|
|
|
1548
1528
|
--------
|
|
1549
1529
|
import asyncio
|
|
1550
1530
|
|
|
1551
|
-
from athena import AsyncAthena
|
|
1531
|
+
from athena import AsyncAthena, CellFormat
|
|
1552
1532
|
|
|
1553
1533
|
client = AsyncAthena(
|
|
1554
1534
|
api_key="YOUR_API_KEY",
|
|
@@ -1560,10 +1540,9 @@ class AsyncSheetsClient:
|
|
|
1560
1540
|
asset_id="asset_id",
|
|
1561
1541
|
end_column=1,
|
|
1562
1542
|
end_row=1,
|
|
1543
|
+
formatting=CellFormat(),
|
|
1563
1544
|
start_column=1,
|
|
1564
1545
|
start_row=1,
|
|
1565
|
-
type="type",
|
|
1566
|
-
value_json="value_json",
|
|
1567
1546
|
)
|
|
1568
1547
|
|
|
1569
1548
|
|
|
@@ -1573,10 +1552,9 @@ class AsyncSheetsClient:
|
|
|
1573
1552
|
asset_id=asset_id,
|
|
1574
1553
|
end_column=end_column,
|
|
1575
1554
|
end_row=end_row,
|
|
1555
|
+
formatting=formatting,
|
|
1576
1556
|
start_column=start_column,
|
|
1577
1557
|
start_row=start_row,
|
|
1578
|
-
type=type,
|
|
1579
|
-
value_json=value_json,
|
|
1580
1558
|
sheet_id=sheet_id,
|
|
1581
1559
|
request_options=request_options,
|
|
1582
1560
|
)
|
|
@@ -1588,7 +1566,8 @@ class AsyncSheetsClient:
|
|
|
1588
1566
|
asset_id: str,
|
|
1589
1567
|
start_column: int,
|
|
1590
1568
|
start_row: int,
|
|
1591
|
-
values: typing.Sequence[
|
|
1569
|
+
values: typing.Sequence[typing.Sequence[typing.Optional[UpdateSheetRangeRequestValuesItemItem]]],
|
|
1570
|
+
formatting: typing.Optional[typing.Sequence[typing.Sequence[typing.Optional[CellFormat]]]] = OMIT,
|
|
1592
1571
|
sheet_id: typing.Optional[int] = OMIT,
|
|
1593
1572
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1594
1573
|
) -> SheetOperationResponse:
|
|
@@ -1606,8 +1585,11 @@ class AsyncSheetsClient:
|
|
|
1606
1585
|
start_row : int
|
|
1607
1586
|
1-based starting row index
|
|
1608
1587
|
|
|
1609
|
-
values : typing.Sequence[
|
|
1610
|
-
|
|
1588
|
+
values : typing.Sequence[typing.Sequence[typing.Optional[UpdateSheetRangeRequestValuesItemItem]]]
|
|
1589
|
+
2D list of cells for each row
|
|
1590
|
+
|
|
1591
|
+
formatting : typing.Optional[typing.Sequence[typing.Sequence[typing.Optional[CellFormat]]]]
|
|
1592
|
+
Optional 2D list of cell formats matching the structure of values. Each row is a list of CellFormat objects for each cell in that row. Use None for cells without formatting. numberFormat is not required unless user explicity asked to change
|
|
1611
1593
|
|
|
1612
1594
|
sheet_id : typing.Optional[int]
|
|
1613
1595
|
Sheet ID (defaults to 1)
|
|
@@ -1636,7 +1618,7 @@ class AsyncSheetsClient:
|
|
|
1636
1618
|
asset_id="asset_id",
|
|
1637
1619
|
start_column=1,
|
|
1638
1620
|
start_row=1,
|
|
1639
|
-
values=[
|
|
1621
|
+
values=[[]],
|
|
1640
1622
|
)
|
|
1641
1623
|
|
|
1642
1624
|
|
|
@@ -1647,6 +1629,7 @@ class AsyncSheetsClient:
|
|
|
1647
1629
|
start_column=start_column,
|
|
1648
1630
|
start_row=start_row,
|
|
1649
1631
|
values=values,
|
|
1632
|
+
formatting=formatting,
|
|
1650
1633
|
sheet_id=sheet_id,
|
|
1651
1634
|
request_options=request_options,
|
|
1652
1635
|
)
|
|
@@ -1770,14 +1753,7 @@ class AsyncSheetsClient:
|
|
|
1770
1753
|
return _response.data
|
|
1771
1754
|
|
|
1772
1755
|
async def create_tab(
|
|
1773
|
-
self,
|
|
1774
|
-
*,
|
|
1775
|
-
asset_id: str,
|
|
1776
|
-
sheet_id: int,
|
|
1777
|
-
title: str,
|
|
1778
|
-
active_sheet_id: typing.Optional[int] = OMIT,
|
|
1779
|
-
tab_color: typing.Optional[str] = OMIT,
|
|
1780
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
1756
|
+
self, *, asset_id: str, sheet: Sheet, request_options: typing.Optional[RequestOptions] = None
|
|
1781
1757
|
) -> CreateNewSheetTabResponse:
|
|
1782
1758
|
"""
|
|
1783
1759
|
Create a new tab in an Athena spreadsheet.
|
|
@@ -1787,17 +1763,8 @@ class AsyncSheetsClient:
|
|
|
1787
1763
|
asset_id : str
|
|
1788
1764
|
The ID of the spreadsheet asset
|
|
1789
1765
|
|
|
1790
|
-
|
|
1791
|
-
Sheet
|
|
1792
|
-
|
|
1793
|
-
title : str
|
|
1794
|
-
Title of the new tab
|
|
1795
|
-
|
|
1796
|
-
active_sheet_id : typing.Optional[int]
|
|
1797
|
-
Currently active sheet ID
|
|
1798
|
-
|
|
1799
|
-
tab_color : typing.Optional[str]
|
|
1800
|
-
Optional color of the new tab
|
|
1766
|
+
sheet : Sheet
|
|
1767
|
+
Sheet Specification
|
|
1801
1768
|
|
|
1802
1769
|
request_options : typing.Optional[RequestOptions]
|
|
1803
1770
|
Request-specific configuration.
|
|
@@ -1811,7 +1778,7 @@ class AsyncSheetsClient:
|
|
|
1811
1778
|
--------
|
|
1812
1779
|
import asyncio
|
|
1813
1780
|
|
|
1814
|
-
from athena import AsyncAthena
|
|
1781
|
+
from athena import AsyncAthena, Sheet
|
|
1815
1782
|
|
|
1816
1783
|
client = AsyncAthena(
|
|
1817
1784
|
api_key="YOUR_API_KEY",
|
|
@@ -1821,21 +1788,19 @@ class AsyncSheetsClient:
|
|
|
1821
1788
|
async def main() -> None:
|
|
1822
1789
|
await client.tools.sheets.create_tab(
|
|
1823
1790
|
asset_id="asset_id",
|
|
1824
|
-
|
|
1825
|
-
|
|
1791
|
+
sheet=Sheet(
|
|
1792
|
+
column_count=1,
|
|
1793
|
+
index=1,
|
|
1794
|
+
row_count=1,
|
|
1795
|
+
sheet_id=1,
|
|
1796
|
+
title="title",
|
|
1797
|
+
),
|
|
1826
1798
|
)
|
|
1827
1799
|
|
|
1828
1800
|
|
|
1829
1801
|
asyncio.run(main())
|
|
1830
1802
|
"""
|
|
1831
|
-
_response = await self._raw_client.create_tab(
|
|
1832
|
-
asset_id=asset_id,
|
|
1833
|
-
sheet_id=sheet_id,
|
|
1834
|
-
title=title,
|
|
1835
|
-
active_sheet_id=active_sheet_id,
|
|
1836
|
-
tab_color=tab_color,
|
|
1837
|
-
request_options=request_options,
|
|
1838
|
-
)
|
|
1803
|
+
_response = await self._raw_client.create_tab(asset_id=asset_id, sheet=sheet, request_options=request_options)
|
|
1839
1804
|
return _response.data
|
|
1840
1805
|
|
|
1841
1806
|
async def delete_table_column(
|