athena-intelligence 0.1.210__py3-none-any.whl → 0.1.303__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 +232 -71
- athena/agents/__init__.py +33 -1
- athena/agents/client.py +81 -18
- athena/aop/client.py +2 -2
- athena/aop/raw_client.py +10 -11
- athena/assets/client.py +359 -2
- athena/assets/raw_client.py +562 -0
- athena/base_client.py +122 -22
- athena/client.py +23 -21
- 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/environment.py +1 -2
- athena/errors/__init__.py +42 -7
- athena/errors/not_found_error.py +1 -2
- athena/query/__init__.py +28 -1
- athena/query/types/__init__.py +30 -1
- athena/threads/raw_client.py +4 -5
- athena/tools/__init__.py +47 -3
- athena/tools/client.py +161 -31
- athena/tools/raw_client.py +36 -34
- athena/tools/sheets/__init__.py +30 -0
- athena/tools/sheets/client.py +100 -122
- athena/tools/sheets/raw_client.py +91 -94
- 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 +196 -54
- athena/types/aop_async_execute_response_out.py +0 -5
- athena/types/aop_execute_response_out.py +7 -6
- athena/types/backgroundcolor.py +7 -0
- athena/types/{document_chunk.py → border_model.py} +7 -4
- athena/types/border_style.py +7 -0
- athena/types/borders_model.py +58 -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 +13 -2
- athena/types/conversation_message.py +42 -0
- athena/types/conversation_result.py +67 -0
- athena/types/creatable_asset_type.py +5 -0
- athena/types/create_asset_response_out.py +46 -0
- athena/types/create_project_response_out.py +51 -0
- athena/types/dimension_properties.py +49 -0
- athena/types/get_table_response.py +7 -2
- athena/types/grid_range.py +39 -0
- athena/types/{file_chunk_request_out.py → number_format_model.py} +8 -4
- athena/types/number_format_type.py +21 -0
- athena/types/sheet.py +76 -0
- athena/types/tabcolor.py +7 -0
- athena/types/table_row_data.py +5 -0
- athena/types/text_format_model.py +28 -0
- athena/types/textrotation.py +5 -0
- athena/types/{asset_not_found_error.py → theme_color.py} +3 -2
- athena/types/thread_status_response_out.py +5 -0
- athena/types/wrap_strategy.py +5 -0
- {athena_intelligence-0.1.210.dist-info → athena_intelligence-0.1.303.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.210.dist-info → athena_intelligence-0.1.303.dist-info}/RECORD +62 -39
- {athena_intelligence-0.1.210.dist-info → athena_intelligence-0.1.303.dist-info}/WHEEL +0 -0
athena/tools/sheets/client.py
CHANGED
|
@@ -4,10 +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
|
|
12
|
+
from ...types.table_row_data import TableRowData
|
|
10
13
|
from .raw_client import AsyncRawSheetsClient, RawSheetsClient
|
|
14
|
+
from .types.update_sheet_range_request_values_item_item import UpdateSheetRangeRequestValuesItemItem
|
|
11
15
|
|
|
12
16
|
# this is used as the default value for optional parameters
|
|
13
17
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -392,10 +396,9 @@ class SheetsClient:
|
|
|
392
396
|
asset_id: str,
|
|
393
397
|
end_column: int,
|
|
394
398
|
end_row: int,
|
|
399
|
+
formatting: CellFormat,
|
|
395
400
|
start_column: int,
|
|
396
401
|
start_row: int,
|
|
397
|
-
type: str,
|
|
398
|
-
value_json: str,
|
|
399
402
|
sheet_id: typing.Optional[int] = OMIT,
|
|
400
403
|
request_options: typing.Optional[RequestOptions] = None,
|
|
401
404
|
) -> SheetOperationResponse:
|
|
@@ -413,18 +416,15 @@ class SheetsClient:
|
|
|
413
416
|
end_row : int
|
|
414
417
|
1-based ending row index
|
|
415
418
|
|
|
419
|
+
formatting : CellFormat
|
|
420
|
+
Cell format
|
|
421
|
+
|
|
416
422
|
start_column : int
|
|
417
423
|
1-based starting column index
|
|
418
424
|
|
|
419
425
|
start_row : int
|
|
420
426
|
1-based starting row index
|
|
421
427
|
|
|
422
|
-
type : str
|
|
423
|
-
Formatting type (e.g. backgroundColor, textFormat, borders, etc.)
|
|
424
|
-
|
|
425
|
-
value_json : str
|
|
426
|
-
JSON string for value param (e.g. '"#FF0000"' or '{"fontSize":12}')
|
|
427
|
-
|
|
428
428
|
sheet_id : typing.Optional[int]
|
|
429
429
|
Sheet ID (defaults to 1)
|
|
430
430
|
|
|
@@ -438,7 +438,7 @@ class SheetsClient:
|
|
|
438
438
|
|
|
439
439
|
Examples
|
|
440
440
|
--------
|
|
441
|
-
from athena import Athena
|
|
441
|
+
from athena import Athena, CellFormat
|
|
442
442
|
|
|
443
443
|
client = Athena(
|
|
444
444
|
api_key="YOUR_API_KEY",
|
|
@@ -447,20 +447,18 @@ class SheetsClient:
|
|
|
447
447
|
asset_id="asset_id",
|
|
448
448
|
end_column=1,
|
|
449
449
|
end_row=1,
|
|
450
|
+
formatting=CellFormat(),
|
|
450
451
|
start_column=1,
|
|
451
452
|
start_row=1,
|
|
452
|
-
type="type",
|
|
453
|
-
value_json="value_json",
|
|
454
453
|
)
|
|
455
454
|
"""
|
|
456
455
|
_response = self._raw_client.format_range(
|
|
457
456
|
asset_id=asset_id,
|
|
458
457
|
end_column=end_column,
|
|
459
458
|
end_row=end_row,
|
|
459
|
+
formatting=formatting,
|
|
460
460
|
start_column=start_column,
|
|
461
461
|
start_row=start_row,
|
|
462
|
-
type=type,
|
|
463
|
-
value_json=value_json,
|
|
464
462
|
sheet_id=sheet_id,
|
|
465
463
|
request_options=request_options,
|
|
466
464
|
)
|
|
@@ -472,7 +470,8 @@ class SheetsClient:
|
|
|
472
470
|
asset_id: str,
|
|
473
471
|
start_column: int,
|
|
474
472
|
start_row: int,
|
|
475
|
-
values: typing.Sequence[
|
|
473
|
+
values: typing.Sequence[typing.Sequence[typing.Optional[UpdateSheetRangeRequestValuesItemItem]]],
|
|
474
|
+
formatting: typing.Optional[typing.Sequence[typing.Sequence[typing.Optional[CellFormat]]]] = OMIT,
|
|
476
475
|
sheet_id: typing.Optional[int] = OMIT,
|
|
477
476
|
request_options: typing.Optional[RequestOptions] = None,
|
|
478
477
|
) -> SheetOperationResponse:
|
|
@@ -490,8 +489,11 @@ class SheetsClient:
|
|
|
490
489
|
start_row : int
|
|
491
490
|
1-based starting row index
|
|
492
491
|
|
|
493
|
-
values : typing.Sequence[
|
|
494
|
-
|
|
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
|
|
495
497
|
|
|
496
498
|
sheet_id : typing.Optional[int]
|
|
497
499
|
Sheet ID (defaults to 1)
|
|
@@ -515,7 +517,7 @@ class SheetsClient:
|
|
|
515
517
|
asset_id="asset_id",
|
|
516
518
|
start_column=1,
|
|
517
519
|
start_row=1,
|
|
518
|
-
values=[
|
|
520
|
+
values=[[]],
|
|
519
521
|
)
|
|
520
522
|
"""
|
|
521
523
|
_response = self._raw_client.update_range(
|
|
@@ -523,6 +525,7 @@ class SheetsClient:
|
|
|
523
525
|
start_column=start_column,
|
|
524
526
|
start_row=start_row,
|
|
525
527
|
values=values,
|
|
528
|
+
formatting=formatting,
|
|
526
529
|
sheet_id=sheet_id,
|
|
527
530
|
request_options=request_options,
|
|
528
531
|
)
|
|
@@ -587,6 +590,7 @@ class SheetsClient:
|
|
|
587
590
|
self,
|
|
588
591
|
*,
|
|
589
592
|
asset_id: str,
|
|
593
|
+
new_sheet_id: typing.Optional[int] = OMIT,
|
|
590
594
|
sheet_id: typing.Optional[int] = OMIT,
|
|
591
595
|
request_options: typing.Optional[RequestOptions] = None,
|
|
592
596
|
) -> SheetOperationResponse:
|
|
@@ -598,6 +602,9 @@ class SheetsClient:
|
|
|
598
602
|
asset_id : str
|
|
599
603
|
The ID of the spreadsheet asset
|
|
600
604
|
|
|
605
|
+
new_sheet_id : typing.Optional[int]
|
|
606
|
+
New sheet ID for the duplicated sheet (auto-generated if not provided)
|
|
607
|
+
|
|
601
608
|
sheet_id : typing.Optional[int]
|
|
602
609
|
Sheet ID to duplicate
|
|
603
610
|
|
|
@@ -621,19 +628,12 @@ class SheetsClient:
|
|
|
621
628
|
)
|
|
622
629
|
"""
|
|
623
630
|
_response = self._raw_client.duplicate_sheet(
|
|
624
|
-
asset_id=asset_id, sheet_id=sheet_id, request_options=request_options
|
|
631
|
+
asset_id=asset_id, new_sheet_id=new_sheet_id, sheet_id=sheet_id, request_options=request_options
|
|
625
632
|
)
|
|
626
633
|
return _response.data
|
|
627
634
|
|
|
628
635
|
def create_tab(
|
|
629
|
-
self,
|
|
630
|
-
*,
|
|
631
|
-
asset_id: str,
|
|
632
|
-
sheet_id: int,
|
|
633
|
-
title: str,
|
|
634
|
-
active_sheet_id: typing.Optional[int] = OMIT,
|
|
635
|
-
tab_color: typing.Optional[str] = OMIT,
|
|
636
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
636
|
+
self, *, asset_id: str, sheet: Sheet, request_options: typing.Optional[RequestOptions] = None
|
|
637
637
|
) -> CreateNewSheetTabResponse:
|
|
638
638
|
"""
|
|
639
639
|
Create a new tab in an Athena spreadsheet.
|
|
@@ -643,17 +643,8 @@ class SheetsClient:
|
|
|
643
643
|
asset_id : str
|
|
644
644
|
The ID of the spreadsheet asset
|
|
645
645
|
|
|
646
|
-
|
|
647
|
-
Sheet
|
|
648
|
-
|
|
649
|
-
title : str
|
|
650
|
-
Title of the new tab
|
|
651
|
-
|
|
652
|
-
active_sheet_id : typing.Optional[int]
|
|
653
|
-
Currently active sheet ID
|
|
654
|
-
|
|
655
|
-
tab_color : typing.Optional[str]
|
|
656
|
-
Optional color of the new tab
|
|
646
|
+
sheet : Sheet
|
|
647
|
+
Sheet Specification
|
|
657
648
|
|
|
658
649
|
request_options : typing.Optional[RequestOptions]
|
|
659
650
|
Request-specific configuration.
|
|
@@ -665,25 +656,23 @@ class SheetsClient:
|
|
|
665
656
|
|
|
666
657
|
Examples
|
|
667
658
|
--------
|
|
668
|
-
from athena import Athena
|
|
659
|
+
from athena import Athena, Sheet
|
|
669
660
|
|
|
670
661
|
client = Athena(
|
|
671
662
|
api_key="YOUR_API_KEY",
|
|
672
663
|
)
|
|
673
664
|
client.tools.sheets.create_tab(
|
|
674
665
|
asset_id="asset_id",
|
|
675
|
-
|
|
676
|
-
|
|
666
|
+
sheet=Sheet(
|
|
667
|
+
column_count=1,
|
|
668
|
+
index=1,
|
|
669
|
+
row_count=1,
|
|
670
|
+
sheet_id=1,
|
|
671
|
+
title="title",
|
|
672
|
+
),
|
|
677
673
|
)
|
|
678
674
|
"""
|
|
679
|
-
_response = self._raw_client.create_tab(
|
|
680
|
-
asset_id=asset_id,
|
|
681
|
-
sheet_id=sheet_id,
|
|
682
|
-
title=title,
|
|
683
|
-
active_sheet_id=active_sheet_id,
|
|
684
|
-
tab_color=tab_color,
|
|
685
|
-
request_options=request_options,
|
|
686
|
-
)
|
|
675
|
+
_response = self._raw_client.create_tab(asset_id=asset_id, sheet=sheet, request_options=request_options)
|
|
687
676
|
return _response.data
|
|
688
677
|
|
|
689
678
|
def delete_table_column(
|
|
@@ -888,8 +877,8 @@ class SheetsClient:
|
|
|
888
877
|
self,
|
|
889
878
|
*,
|
|
890
879
|
asset_id: str,
|
|
880
|
+
table_name: str,
|
|
891
881
|
table_id: typing.Optional[str] = OMIT,
|
|
892
|
-
table_name: typing.Optional[str] = OMIT,
|
|
893
882
|
request_options: typing.Optional[RequestOptions] = None,
|
|
894
883
|
) -> GetTableResponse:
|
|
895
884
|
"""
|
|
@@ -900,12 +889,12 @@ class SheetsClient:
|
|
|
900
889
|
asset_id : str
|
|
901
890
|
The ID of the spreadsheet asset
|
|
902
891
|
|
|
892
|
+
table_name : str
|
|
893
|
+
Table name to retrieve
|
|
894
|
+
|
|
903
895
|
table_id : typing.Optional[str]
|
|
904
896
|
Table ID to retrieve
|
|
905
897
|
|
|
906
|
-
table_name : typing.Optional[str]
|
|
907
|
-
Table name to retrieve
|
|
908
|
-
|
|
909
898
|
request_options : typing.Optional[RequestOptions]
|
|
910
899
|
Request-specific configuration.
|
|
911
900
|
|
|
@@ -923,10 +912,11 @@ class SheetsClient:
|
|
|
923
912
|
)
|
|
924
913
|
client.tools.sheets.get_table(
|
|
925
914
|
asset_id="asset_id",
|
|
915
|
+
table_name="table_name",
|
|
926
916
|
)
|
|
927
917
|
"""
|
|
928
918
|
_response = self._raw_client.get_table(
|
|
929
|
-
asset_id=asset_id,
|
|
919
|
+
asset_id=asset_id, table_name=table_name, table_id=table_id, request_options=request_options
|
|
930
920
|
)
|
|
931
921
|
return _response.data
|
|
932
922
|
|
|
@@ -934,9 +924,9 @@ class SheetsClient:
|
|
|
934
924
|
self,
|
|
935
925
|
*,
|
|
936
926
|
asset_id: str,
|
|
937
|
-
row_data: typing.Sequence[
|
|
927
|
+
row_data: typing.Sequence[TableRowData],
|
|
928
|
+
table_name: str,
|
|
938
929
|
table_id: typing.Optional[str] = OMIT,
|
|
939
|
-
table_name: typing.Optional[str] = OMIT,
|
|
940
930
|
request_options: typing.Optional[RequestOptions] = None,
|
|
941
931
|
) -> SheetOperationResponse:
|
|
942
932
|
"""
|
|
@@ -947,15 +937,15 @@ class SheetsClient:
|
|
|
947
937
|
asset_id : str
|
|
948
938
|
The ID of the spreadsheet asset
|
|
949
939
|
|
|
950
|
-
row_data : typing.Sequence[
|
|
940
|
+
row_data : typing.Sequence[TableRowData]
|
|
951
941
|
Array of row objects where keys are column names and values are cell values
|
|
952
942
|
|
|
943
|
+
table_name : str
|
|
944
|
+
Table name to insert row into
|
|
945
|
+
|
|
953
946
|
table_id : typing.Optional[str]
|
|
954
947
|
Table ID to insert row into
|
|
955
948
|
|
|
956
|
-
table_name : typing.Optional[str]
|
|
957
|
-
Table name to insert row into
|
|
958
|
-
|
|
959
949
|
request_options : typing.Optional[RequestOptions]
|
|
960
950
|
Request-specific configuration.
|
|
961
951
|
|
|
@@ -973,14 +963,15 @@ class SheetsClient:
|
|
|
973
963
|
)
|
|
974
964
|
client.tools.sheets.insert_table_row(
|
|
975
965
|
asset_id="asset_id",
|
|
976
|
-
row_data=[{}],
|
|
966
|
+
row_data=[{"key": "value"}],
|
|
967
|
+
table_name="table_name",
|
|
977
968
|
)
|
|
978
969
|
"""
|
|
979
970
|
_response = self._raw_client.insert_table_row(
|
|
980
971
|
asset_id=asset_id,
|
|
981
972
|
row_data=row_data,
|
|
982
|
-
table_id=table_id,
|
|
983
973
|
table_name=table_name,
|
|
974
|
+
table_id=table_id,
|
|
984
975
|
request_options=request_options,
|
|
985
976
|
)
|
|
986
977
|
return _response.data
|
|
@@ -1493,10 +1484,9 @@ class AsyncSheetsClient:
|
|
|
1493
1484
|
asset_id: str,
|
|
1494
1485
|
end_column: int,
|
|
1495
1486
|
end_row: int,
|
|
1487
|
+
formatting: CellFormat,
|
|
1496
1488
|
start_column: int,
|
|
1497
1489
|
start_row: int,
|
|
1498
|
-
type: str,
|
|
1499
|
-
value_json: str,
|
|
1500
1490
|
sheet_id: typing.Optional[int] = OMIT,
|
|
1501
1491
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1502
1492
|
) -> SheetOperationResponse:
|
|
@@ -1514,18 +1504,15 @@ class AsyncSheetsClient:
|
|
|
1514
1504
|
end_row : int
|
|
1515
1505
|
1-based ending row index
|
|
1516
1506
|
|
|
1507
|
+
formatting : CellFormat
|
|
1508
|
+
Cell format
|
|
1509
|
+
|
|
1517
1510
|
start_column : int
|
|
1518
1511
|
1-based starting column index
|
|
1519
1512
|
|
|
1520
1513
|
start_row : int
|
|
1521
1514
|
1-based starting row index
|
|
1522
1515
|
|
|
1523
|
-
type : str
|
|
1524
|
-
Formatting type (e.g. backgroundColor, textFormat, borders, etc.)
|
|
1525
|
-
|
|
1526
|
-
value_json : str
|
|
1527
|
-
JSON string for value param (e.g. '"#FF0000"' or '{"fontSize":12}')
|
|
1528
|
-
|
|
1529
1516
|
sheet_id : typing.Optional[int]
|
|
1530
1517
|
Sheet ID (defaults to 1)
|
|
1531
1518
|
|
|
@@ -1541,7 +1528,7 @@ class AsyncSheetsClient:
|
|
|
1541
1528
|
--------
|
|
1542
1529
|
import asyncio
|
|
1543
1530
|
|
|
1544
|
-
from athena import AsyncAthena
|
|
1531
|
+
from athena import AsyncAthena, CellFormat
|
|
1545
1532
|
|
|
1546
1533
|
client = AsyncAthena(
|
|
1547
1534
|
api_key="YOUR_API_KEY",
|
|
@@ -1553,10 +1540,9 @@ class AsyncSheetsClient:
|
|
|
1553
1540
|
asset_id="asset_id",
|
|
1554
1541
|
end_column=1,
|
|
1555
1542
|
end_row=1,
|
|
1543
|
+
formatting=CellFormat(),
|
|
1556
1544
|
start_column=1,
|
|
1557
1545
|
start_row=1,
|
|
1558
|
-
type="type",
|
|
1559
|
-
value_json="value_json",
|
|
1560
1546
|
)
|
|
1561
1547
|
|
|
1562
1548
|
|
|
@@ -1566,10 +1552,9 @@ class AsyncSheetsClient:
|
|
|
1566
1552
|
asset_id=asset_id,
|
|
1567
1553
|
end_column=end_column,
|
|
1568
1554
|
end_row=end_row,
|
|
1555
|
+
formatting=formatting,
|
|
1569
1556
|
start_column=start_column,
|
|
1570
1557
|
start_row=start_row,
|
|
1571
|
-
type=type,
|
|
1572
|
-
value_json=value_json,
|
|
1573
1558
|
sheet_id=sheet_id,
|
|
1574
1559
|
request_options=request_options,
|
|
1575
1560
|
)
|
|
@@ -1581,7 +1566,8 @@ class AsyncSheetsClient:
|
|
|
1581
1566
|
asset_id: str,
|
|
1582
1567
|
start_column: int,
|
|
1583
1568
|
start_row: int,
|
|
1584
|
-
values: typing.Sequence[
|
|
1569
|
+
values: typing.Sequence[typing.Sequence[typing.Optional[UpdateSheetRangeRequestValuesItemItem]]],
|
|
1570
|
+
formatting: typing.Optional[typing.Sequence[typing.Sequence[typing.Optional[CellFormat]]]] = OMIT,
|
|
1585
1571
|
sheet_id: typing.Optional[int] = OMIT,
|
|
1586
1572
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1587
1573
|
) -> SheetOperationResponse:
|
|
@@ -1599,8 +1585,11 @@ class AsyncSheetsClient:
|
|
|
1599
1585
|
start_row : int
|
|
1600
1586
|
1-based starting row index
|
|
1601
1587
|
|
|
1602
|
-
values : typing.Sequence[
|
|
1603
|
-
|
|
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
|
|
1604
1593
|
|
|
1605
1594
|
sheet_id : typing.Optional[int]
|
|
1606
1595
|
Sheet ID (defaults to 1)
|
|
@@ -1629,7 +1618,7 @@ class AsyncSheetsClient:
|
|
|
1629
1618
|
asset_id="asset_id",
|
|
1630
1619
|
start_column=1,
|
|
1631
1620
|
start_row=1,
|
|
1632
|
-
values=[
|
|
1621
|
+
values=[[]],
|
|
1633
1622
|
)
|
|
1634
1623
|
|
|
1635
1624
|
|
|
@@ -1640,6 +1629,7 @@ class AsyncSheetsClient:
|
|
|
1640
1629
|
start_column=start_column,
|
|
1641
1630
|
start_row=start_row,
|
|
1642
1631
|
values=values,
|
|
1632
|
+
formatting=formatting,
|
|
1643
1633
|
sheet_id=sheet_id,
|
|
1644
1634
|
request_options=request_options,
|
|
1645
1635
|
)
|
|
@@ -1712,6 +1702,7 @@ class AsyncSheetsClient:
|
|
|
1712
1702
|
self,
|
|
1713
1703
|
*,
|
|
1714
1704
|
asset_id: str,
|
|
1705
|
+
new_sheet_id: typing.Optional[int] = OMIT,
|
|
1715
1706
|
sheet_id: typing.Optional[int] = OMIT,
|
|
1716
1707
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1717
1708
|
) -> SheetOperationResponse:
|
|
@@ -1723,6 +1714,9 @@ class AsyncSheetsClient:
|
|
|
1723
1714
|
asset_id : str
|
|
1724
1715
|
The ID of the spreadsheet asset
|
|
1725
1716
|
|
|
1717
|
+
new_sheet_id : typing.Optional[int]
|
|
1718
|
+
New sheet ID for the duplicated sheet (auto-generated if not provided)
|
|
1719
|
+
|
|
1726
1720
|
sheet_id : typing.Optional[int]
|
|
1727
1721
|
Sheet ID to duplicate
|
|
1728
1722
|
|
|
@@ -1754,19 +1748,12 @@ class AsyncSheetsClient:
|
|
|
1754
1748
|
asyncio.run(main())
|
|
1755
1749
|
"""
|
|
1756
1750
|
_response = await self._raw_client.duplicate_sheet(
|
|
1757
|
-
asset_id=asset_id, sheet_id=sheet_id, request_options=request_options
|
|
1751
|
+
asset_id=asset_id, new_sheet_id=new_sheet_id, sheet_id=sheet_id, request_options=request_options
|
|
1758
1752
|
)
|
|
1759
1753
|
return _response.data
|
|
1760
1754
|
|
|
1761
1755
|
async def create_tab(
|
|
1762
|
-
self,
|
|
1763
|
-
*,
|
|
1764
|
-
asset_id: str,
|
|
1765
|
-
sheet_id: int,
|
|
1766
|
-
title: str,
|
|
1767
|
-
active_sheet_id: typing.Optional[int] = OMIT,
|
|
1768
|
-
tab_color: typing.Optional[str] = OMIT,
|
|
1769
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
1756
|
+
self, *, asset_id: str, sheet: Sheet, request_options: typing.Optional[RequestOptions] = None
|
|
1770
1757
|
) -> CreateNewSheetTabResponse:
|
|
1771
1758
|
"""
|
|
1772
1759
|
Create a new tab in an Athena spreadsheet.
|
|
@@ -1776,17 +1763,8 @@ class AsyncSheetsClient:
|
|
|
1776
1763
|
asset_id : str
|
|
1777
1764
|
The ID of the spreadsheet asset
|
|
1778
1765
|
|
|
1779
|
-
|
|
1780
|
-
Sheet
|
|
1781
|
-
|
|
1782
|
-
title : str
|
|
1783
|
-
Title of the new tab
|
|
1784
|
-
|
|
1785
|
-
active_sheet_id : typing.Optional[int]
|
|
1786
|
-
Currently active sheet ID
|
|
1787
|
-
|
|
1788
|
-
tab_color : typing.Optional[str]
|
|
1789
|
-
Optional color of the new tab
|
|
1766
|
+
sheet : Sheet
|
|
1767
|
+
Sheet Specification
|
|
1790
1768
|
|
|
1791
1769
|
request_options : typing.Optional[RequestOptions]
|
|
1792
1770
|
Request-specific configuration.
|
|
@@ -1800,7 +1778,7 @@ class AsyncSheetsClient:
|
|
|
1800
1778
|
--------
|
|
1801
1779
|
import asyncio
|
|
1802
1780
|
|
|
1803
|
-
from athena import AsyncAthena
|
|
1781
|
+
from athena import AsyncAthena, Sheet
|
|
1804
1782
|
|
|
1805
1783
|
client = AsyncAthena(
|
|
1806
1784
|
api_key="YOUR_API_KEY",
|
|
@@ -1810,21 +1788,19 @@ class AsyncSheetsClient:
|
|
|
1810
1788
|
async def main() -> None:
|
|
1811
1789
|
await client.tools.sheets.create_tab(
|
|
1812
1790
|
asset_id="asset_id",
|
|
1813
|
-
|
|
1814
|
-
|
|
1791
|
+
sheet=Sheet(
|
|
1792
|
+
column_count=1,
|
|
1793
|
+
index=1,
|
|
1794
|
+
row_count=1,
|
|
1795
|
+
sheet_id=1,
|
|
1796
|
+
title="title",
|
|
1797
|
+
),
|
|
1815
1798
|
)
|
|
1816
1799
|
|
|
1817
1800
|
|
|
1818
1801
|
asyncio.run(main())
|
|
1819
1802
|
"""
|
|
1820
|
-
_response = await self._raw_client.create_tab(
|
|
1821
|
-
asset_id=asset_id,
|
|
1822
|
-
sheet_id=sheet_id,
|
|
1823
|
-
title=title,
|
|
1824
|
-
active_sheet_id=active_sheet_id,
|
|
1825
|
-
tab_color=tab_color,
|
|
1826
|
-
request_options=request_options,
|
|
1827
|
-
)
|
|
1803
|
+
_response = await self._raw_client.create_tab(asset_id=asset_id, sheet=sheet, request_options=request_options)
|
|
1828
1804
|
return _response.data
|
|
1829
1805
|
|
|
1830
1806
|
async def delete_table_column(
|
|
@@ -2053,8 +2029,8 @@ class AsyncSheetsClient:
|
|
|
2053
2029
|
self,
|
|
2054
2030
|
*,
|
|
2055
2031
|
asset_id: str,
|
|
2032
|
+
table_name: str,
|
|
2056
2033
|
table_id: typing.Optional[str] = OMIT,
|
|
2057
|
-
table_name: typing.Optional[str] = OMIT,
|
|
2058
2034
|
request_options: typing.Optional[RequestOptions] = None,
|
|
2059
2035
|
) -> GetTableResponse:
|
|
2060
2036
|
"""
|
|
@@ -2065,12 +2041,12 @@ class AsyncSheetsClient:
|
|
|
2065
2041
|
asset_id : str
|
|
2066
2042
|
The ID of the spreadsheet asset
|
|
2067
2043
|
|
|
2044
|
+
table_name : str
|
|
2045
|
+
Table name to retrieve
|
|
2046
|
+
|
|
2068
2047
|
table_id : typing.Optional[str]
|
|
2069
2048
|
Table ID to retrieve
|
|
2070
2049
|
|
|
2071
|
-
table_name : typing.Optional[str]
|
|
2072
|
-
Table name to retrieve
|
|
2073
|
-
|
|
2074
2050
|
request_options : typing.Optional[RequestOptions]
|
|
2075
2051
|
Request-specific configuration.
|
|
2076
2052
|
|
|
@@ -2093,13 +2069,14 @@ class AsyncSheetsClient:
|
|
|
2093
2069
|
async def main() -> None:
|
|
2094
2070
|
await client.tools.sheets.get_table(
|
|
2095
2071
|
asset_id="asset_id",
|
|
2072
|
+
table_name="table_name",
|
|
2096
2073
|
)
|
|
2097
2074
|
|
|
2098
2075
|
|
|
2099
2076
|
asyncio.run(main())
|
|
2100
2077
|
"""
|
|
2101
2078
|
_response = await self._raw_client.get_table(
|
|
2102
|
-
asset_id=asset_id,
|
|
2079
|
+
asset_id=asset_id, table_name=table_name, table_id=table_id, request_options=request_options
|
|
2103
2080
|
)
|
|
2104
2081
|
return _response.data
|
|
2105
2082
|
|
|
@@ -2107,9 +2084,9 @@ class AsyncSheetsClient:
|
|
|
2107
2084
|
self,
|
|
2108
2085
|
*,
|
|
2109
2086
|
asset_id: str,
|
|
2110
|
-
row_data: typing.Sequence[
|
|
2087
|
+
row_data: typing.Sequence[TableRowData],
|
|
2088
|
+
table_name: str,
|
|
2111
2089
|
table_id: typing.Optional[str] = OMIT,
|
|
2112
|
-
table_name: typing.Optional[str] = OMIT,
|
|
2113
2090
|
request_options: typing.Optional[RequestOptions] = None,
|
|
2114
2091
|
) -> SheetOperationResponse:
|
|
2115
2092
|
"""
|
|
@@ -2120,15 +2097,15 @@ class AsyncSheetsClient:
|
|
|
2120
2097
|
asset_id : str
|
|
2121
2098
|
The ID of the spreadsheet asset
|
|
2122
2099
|
|
|
2123
|
-
row_data : typing.Sequence[
|
|
2100
|
+
row_data : typing.Sequence[TableRowData]
|
|
2124
2101
|
Array of row objects where keys are column names and values are cell values
|
|
2125
2102
|
|
|
2103
|
+
table_name : str
|
|
2104
|
+
Table name to insert row into
|
|
2105
|
+
|
|
2126
2106
|
table_id : typing.Optional[str]
|
|
2127
2107
|
Table ID to insert row into
|
|
2128
2108
|
|
|
2129
|
-
table_name : typing.Optional[str]
|
|
2130
|
-
Table name to insert row into
|
|
2131
|
-
|
|
2132
2109
|
request_options : typing.Optional[RequestOptions]
|
|
2133
2110
|
Request-specific configuration.
|
|
2134
2111
|
|
|
@@ -2151,7 +2128,8 @@ class AsyncSheetsClient:
|
|
|
2151
2128
|
async def main() -> None:
|
|
2152
2129
|
await client.tools.sheets.insert_table_row(
|
|
2153
2130
|
asset_id="asset_id",
|
|
2154
|
-
row_data=[{}],
|
|
2131
|
+
row_data=[{"key": "value"}],
|
|
2132
|
+
table_name="table_name",
|
|
2155
2133
|
)
|
|
2156
2134
|
|
|
2157
2135
|
|
|
@@ -2160,8 +2138,8 @@ class AsyncSheetsClient:
|
|
|
2160
2138
|
_response = await self._raw_client.insert_table_row(
|
|
2161
2139
|
asset_id=asset_id,
|
|
2162
2140
|
row_data=row_data,
|
|
2163
|
-
table_id=table_id,
|
|
2164
2141
|
table_name=table_name,
|
|
2142
|
+
table_id=table_id,
|
|
2165
2143
|
request_options=request_options,
|
|
2166
2144
|
)
|
|
2167
2145
|
return _response.data
|