python-google-sheets 1.1.0__py3-none-any.whl → 1.2.0__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.
- google_sheets/api_request.py +12 -10
- google_sheets/google_sheets.py +52 -40
- google_sheets/spreadsheet_requests/__init__.py +3 -0
- google_sheets/spreadsheet_requests/general_models.py +12 -0
- {python_google_sheets-1.1.0.dist-info → python_google_sheets-1.2.0.dist-info}/METADATA +46 -19
- {python_google_sheets-1.1.0.dist-info → python_google_sheets-1.2.0.dist-info}/RECORD +9 -9
- {python_google_sheets-1.1.0.dist-info → python_google_sheets-1.2.0.dist-info}/WHEEL +0 -0
- {python_google_sheets-1.1.0.dist-info → python_google_sheets-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {python_google_sheets-1.1.0.dist-info → python_google_sheets-1.2.0.dist-info}/top_level.txt +0 -0
google_sheets/api_request.py
CHANGED
|
@@ -112,10 +112,10 @@ class ApiRequest:
|
|
|
112
112
|
|
|
113
113
|
@staticmethod
|
|
114
114
|
def add_boolean_format_rule(
|
|
115
|
-
*,
|
|
116
115
|
sheet_id: int,
|
|
117
116
|
ranges: list[str],
|
|
118
117
|
condition_type: ConditionType,
|
|
118
|
+
*,
|
|
119
119
|
condition_values: list[ConditionValue] = None,
|
|
120
120
|
cell_format: CellFormat,
|
|
121
121
|
) -> dict:
|
|
@@ -143,8 +143,8 @@ class ApiRequest:
|
|
|
143
143
|
|
|
144
144
|
@staticmethod
|
|
145
145
|
def add(
|
|
146
|
-
*,
|
|
147
146
|
sheet_id: int,
|
|
147
|
+
*,
|
|
148
148
|
ranges: list[str],
|
|
149
149
|
interpolation_points: tuple[IPTypeAndValue, IPTypeAndValue] | tuple[IPTypeAndValue, IPTypeAndValue, IPTypeAndValue],
|
|
150
150
|
interpolation_point_colors: tuple[ColorStyle, ColorStyle] | tuple[ColorStyle, ColorStyle, ColorStyle],
|
|
@@ -210,10 +210,11 @@ class ApiRequest:
|
|
|
210
210
|
RED_YELLOW_GREEN_PERCENT = 'RED_YELLOW_GREEN_PERCENT'
|
|
211
211
|
|
|
212
212
|
@staticmethod
|
|
213
|
-
def add_preset(
|
|
213
|
+
def add_preset(sheet_id: int, ranges: list[str], preset: Preset) -> dict:
|
|
214
214
|
grid_ranges = [GridRange(sheet_id=sheet_id, **ApiRequest._split_excel_range(range_, return_as_dict=True)) for range_ in ranges]
|
|
215
215
|
AGP = ApiRequest.GradientRule.Preset
|
|
216
216
|
|
|
217
|
+
# Two interpolation points presets
|
|
217
218
|
if preset in (AGP.WHITE_GREEN, AGP.WHITE_YELLOW, AGP.WHITE_RED, AGP.GREEN_WHITE, AGP.YELLOW_WHITE, AGP.RED_WHITE):
|
|
218
219
|
if preset == AGP.WHITE_YELLOW:
|
|
219
220
|
minpoint_color_style, maxpoint_color_style = Color_.Basic.WHITE, Color_.ConditionalFormatting.YELLOW
|
|
@@ -242,7 +243,7 @@ class ApiRequest:
|
|
|
242
243
|
)
|
|
243
244
|
)).dict()
|
|
244
245
|
|
|
245
|
-
else: #
|
|
246
|
+
else: # Three interpolation points presets
|
|
246
247
|
if preset in (AGP.RED_WHITE_GREEN_PERCENTILE, AGP.RED_WHITE_GREEN_PERCENT):
|
|
247
248
|
minpoint_cs, midpoint_cs, maxpoint_cs = Color_.ConditionalFormatting.RED, Color_.Basic.WHITE, Color_.ConditionalFormatting.GREEN
|
|
248
249
|
midpoint_type = InterpolationPointType.PERCENTILE if preset == AGP.RED_WHITE_GREEN_PERCENTILE else InterpolationPointType.PERCENT
|
|
@@ -276,11 +277,11 @@ class ApiRequest:
|
|
|
276
277
|
)).dict()
|
|
277
278
|
|
|
278
279
|
@staticmethod
|
|
279
|
-
def delete_conditional_format_rule(
|
|
280
|
+
def delete_conditional_format_rule(sheet_id: int, *, index: int) -> dict:
|
|
280
281
|
return DeleteConditionalFormatRule(sheet_id=sheet_id, index=index).dict()
|
|
281
282
|
|
|
282
283
|
@staticmethod
|
|
283
|
-
def update_conditional_format_rule(
|
|
284
|
+
def update_conditional_format_rule(sheet_id: int, *, index: int, rule: ConditionalFormatRule) -> dict:
|
|
284
285
|
return UpdateConditionalFormatRule(sheet_id=sheet_id, index=index, rule=rule).dict()
|
|
285
286
|
|
|
286
287
|
@staticmethod
|
|
@@ -341,6 +342,7 @@ class ApiRequest:
|
|
|
341
342
|
@staticmethod
|
|
342
343
|
def unmerge_cells(
|
|
343
344
|
sheet_id: int,
|
|
345
|
+
*,
|
|
344
346
|
range_: str = None,
|
|
345
347
|
start_row: int = None,
|
|
346
348
|
end_row: int = None,
|
|
@@ -377,7 +379,7 @@ class ApiRequest:
|
|
|
377
379
|
).dict()
|
|
378
380
|
|
|
379
381
|
@staticmethod
|
|
380
|
-
def insert_rows(sheet_id: int, start_index: int, end_index: int = None, inherit_from_before: bool = True) -> dict:
|
|
382
|
+
def insert_rows(sheet_id: int, start_index: int, end_index: int = None, *, inherit_from_before: bool = True) -> dict:
|
|
381
383
|
"""
|
|
382
384
|
Indexes are zero-based and inclusive [start_index, end_index]. If end_index is not specified, then a single
|
|
383
385
|
row will be inserted at start_index.
|
|
@@ -394,7 +396,7 @@ class ApiRequest:
|
|
|
394
396
|
).dict()
|
|
395
397
|
|
|
396
398
|
@staticmethod
|
|
397
|
-
def insert_columns(sheet_id: int, start_index: int, end_index: int = None, inherit_from_before: bool = True) -> dict:
|
|
399
|
+
def insert_columns(sheet_id: int, start_index: int, end_index: int = None, *, inherit_from_before: bool = True) -> dict:
|
|
398
400
|
"""
|
|
399
401
|
Indexes are zero-based and inclusive [start_index, end_index]. If end_index is not specified, then a single
|
|
400
402
|
column will be inserted at start_index.
|
|
@@ -549,8 +551,8 @@ class ApiRequest:
|
|
|
549
551
|
|
|
550
552
|
@staticmethod
|
|
551
553
|
def add_sheet(
|
|
552
|
-
*,
|
|
553
554
|
sheet_id: int = None,
|
|
555
|
+
*,
|
|
554
556
|
title: str = None,
|
|
555
557
|
index: int = None,
|
|
556
558
|
hidden: bool = None,
|
|
@@ -575,7 +577,7 @@ class ApiRequest:
|
|
|
575
577
|
)).dict()
|
|
576
578
|
|
|
577
579
|
@staticmethod
|
|
578
|
-
def _split_excel_range(range_: str, return_as_dict: bool = False) -> tuple[int, int, int, int] | dict[str, int]:
|
|
580
|
+
def _split_excel_range(range_: str, *, return_as_dict: bool = False) -> tuple[int, int, int, int] | dict[str, int]:
|
|
579
581
|
if ':' in range_:
|
|
580
582
|
match = re.match(r'([A-Z]+)(\d+):([A-Z]+)(\d+)$', range_)
|
|
581
583
|
if not match:
|
google_sheets/google_sheets.py
CHANGED
|
@@ -4,7 +4,7 @@ from google.oauth2.service_account import Credentials
|
|
|
4
4
|
from googleapiclient.discovery import build
|
|
5
5
|
from googleapiclient.errors import HttpError
|
|
6
6
|
|
|
7
|
-
from .spreadsheet_requests import Spreadsheet, SheetProperties,
|
|
7
|
+
from .spreadsheet_requests import Spreadsheet, SheetProperties, RangeData, Dimension, ValueRenderOption, DateTimeRenderOption
|
|
8
8
|
|
|
9
9
|
if TYPE_CHECKING:
|
|
10
10
|
from googleapiclient.discovery import Resource # noqa
|
|
@@ -85,7 +85,7 @@ class GoogleSheets:
|
|
|
85
85
|
return spreadsheet_id, f'https://docs.google.com/spreadsheets/d/{spreadsheet_id}'
|
|
86
86
|
|
|
87
87
|
@staticmethod
|
|
88
|
-
def update_spreadsheet(spreadsheet_id: str, api_requests: list[dict], service: 'Resource') -> None:
|
|
88
|
+
def update_spreadsheet(spreadsheet_id: str, api_requests: list[dict], *, service: 'Resource') -> None:
|
|
89
89
|
"""
|
|
90
90
|
Updates Google Sheet with the specified API requests.
|
|
91
91
|
|
|
@@ -100,7 +100,7 @@ class GoogleSheets:
|
|
|
100
100
|
raise e
|
|
101
101
|
|
|
102
102
|
@staticmethod
|
|
103
|
-
def copy_sheet(source_spreadsheet_id: str, source_sheet_id: str, destination_spreadsheet_id: str, service: 'Resource') -> SheetProperties:
|
|
103
|
+
def copy_sheet(source_spreadsheet_id: str, source_sheet_id: str, destination_spreadsheet_id: str, *, service: 'Resource') -> SheetProperties:
|
|
104
104
|
request = service.spreadsheets().sheets().copyTo(
|
|
105
105
|
spreadsheetId=source_spreadsheet_id,
|
|
106
106
|
sheetId=source_sheet_id,
|
|
@@ -118,63 +118,75 @@ class GoogleSheets:
|
|
|
118
118
|
@staticmethod
|
|
119
119
|
def get_spreadsheet_range_values(
|
|
120
120
|
spreadsheet_id: str,
|
|
121
|
-
sheets: list[str | int],
|
|
122
|
-
ranges: list[list[str]],
|
|
121
|
+
sheets: list[str | int] | str | int,
|
|
122
|
+
ranges: list[list[str]] | list[str] | str,
|
|
123
|
+
*,
|
|
124
|
+
by_columns: bool = False,
|
|
123
125
|
service: 'Resource'
|
|
124
|
-
) -> list[list[
|
|
126
|
+
) -> list[list[RangeData]] | None:
|
|
125
127
|
"""
|
|
126
128
|
Reads values from the specified ranges of the table.
|
|
127
129
|
IMPORTANT: If the last cells in the range are empty, they will be omitted. If all cells are empty, an empty
|
|
128
130
|
list will be returned for that range. However, leading empty cells are preserved and will appear in
|
|
129
|
-
the result
|
|
131
|
+
the result.
|
|
130
132
|
|
|
131
133
|
Args:
|
|
132
|
-
spreadsheet_id (str): ID of the table
|
|
133
|
-
sheets (list[str | int]): Name or ID of the
|
|
134
|
-
ranges (list[list[str]]):
|
|
135
|
-
|
|
134
|
+
spreadsheet_id (str): ID of the table.
|
|
135
|
+
sheets (list[str | int] | str | int): Name or ID of the sheet(s).
|
|
136
|
+
ranges (list[list[str]] | list[str] | str): Single range or list of ranges from each sheet in A1 notation.
|
|
137
|
+
by_columns (bool, optional): If True, returns data organized by columns instead of rows. Defaults to False.
|
|
138
|
+
service (googleapiclient.discovery.Resource): Google Sheets service object.
|
|
136
139
|
|
|
137
140
|
Returns:
|
|
138
|
-
list[list[
|
|
139
|
-
corresponds to an element in the list. If the range is a single row or a single column, a list of values
|
|
140
|
-
is returned Otherwise, a list of lists of values is returned.
|
|
141
|
+
list[list[RangeData]] | None: For each range of each sheet, returns a matrix of values (RangeData - list[list[SimpleType]]). Returns None if an error occurs.
|
|
141
142
|
"""
|
|
142
|
-
assert
|
|
143
|
+
assert \
|
|
144
|
+
( # sheets: list[str | int], ranges: list[list[str]]
|
|
145
|
+
isinstance(sheets, list) and not isinstance(sheets[0], list) and
|
|
146
|
+
isinstance(ranges, list) and isinstance(ranges[0], list) and not isinstance(ranges[0][0], list) and
|
|
147
|
+
len(sheets) == len(ranges)
|
|
148
|
+
) or ( # sheets: str | int, ranges: list[str] | str
|
|
149
|
+
(isinstance(sheets, str) or isinstance(sheets, int)) and
|
|
150
|
+
(isinstance(ranges, list) and not isinstance(ranges[0], list) or isinstance(ranges, str))
|
|
151
|
+
), 'sheets and ranges must be either list[str | int] and list[list[str]] respectively and same size, or str | int and list[str] | str respectively'
|
|
152
|
+
|
|
153
|
+
# Normalize sheets and ranges to list[str | int] and list[list[str]] respectively
|
|
154
|
+
if isinstance(ranges, str):
|
|
155
|
+
ranges = [ranges]
|
|
156
|
+
if isinstance(sheets, str) or isinstance(sheets, int):
|
|
157
|
+
sheets = [sheets]
|
|
158
|
+
ranges = [ranges]
|
|
143
159
|
|
|
144
160
|
ranges_processed = []
|
|
161
|
+
ss = None
|
|
145
162
|
if any(isinstance(sheet, int) for sheet in sheets):
|
|
146
163
|
ss = GoogleSheets.get_spreadsheet(spreadsheet_id, service)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
164
|
+
for sheet_id_or_name, sheet_ranges in zip(sheets, ranges):
|
|
165
|
+
if isinstance(sheet_id_or_name, int):
|
|
166
|
+
try:
|
|
167
|
+
sheet_name = next(sht.properties.title for sht in ss.sheets if sht.properties.sheet_id == sheet_id_or_name)
|
|
168
|
+
except StopIteration:
|
|
169
|
+
return None
|
|
170
|
+
else:
|
|
171
|
+
sheet_name = sheet_id_or_name
|
|
172
|
+
ranges_processed.extend([f'{sheet_name}!{range_}' for range_ in sheet_ranges])
|
|
154
173
|
|
|
155
174
|
try:
|
|
156
175
|
response = service.spreadsheets().values().batchGet(
|
|
157
176
|
spreadsheetId=spreadsheet_id,
|
|
158
177
|
ranges=ranges_processed,
|
|
159
|
-
|
|
160
|
-
|
|
178
|
+
majorDimension=Dimension.COLUMNS if by_columns else Dimension.ROWS,
|
|
179
|
+
valueRenderOption=ValueRenderOption.UNFORMATTED_VALUE,
|
|
180
|
+
dateTimeRenderOption=DateTimeRenderOption.FORMATTED_STRING
|
|
161
181
|
).execute(num_retries=5)
|
|
162
|
-
except HttpError
|
|
163
|
-
|
|
182
|
+
except HttpError:
|
|
183
|
+
return None
|
|
164
184
|
else:
|
|
165
185
|
result = []
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if len(values) == 1: # If range is a single row
|
|
173
|
-
result.append(values[0])
|
|
174
|
-
else:
|
|
175
|
-
if max([len(row) for row in values]) <= 1: # If range is a single column
|
|
176
|
-
result.append([(row[0] if row else '') for row in values])
|
|
177
|
-
else:
|
|
178
|
-
result.append(values)
|
|
179
|
-
|
|
186
|
+
value_ranges = iter(response.get('valueRanges', []))
|
|
187
|
+
for sheet_no in range(len(ranges)):
|
|
188
|
+
sheet_ranges = []
|
|
189
|
+
for range_no in range(len(ranges[sheet_no])):
|
|
190
|
+
sheet_ranges.append(next(value_ranges).get('values', []))
|
|
191
|
+
result.append(sheet_ranges)
|
|
180
192
|
return result
|
|
@@ -4,6 +4,18 @@ from pydantic import BaseModel, Field, model_validator
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
SimpleType = str | int | float | bool
|
|
7
|
+
RangeData = list[list[SimpleType]]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ValueRenderOption(StrEnum):
|
|
11
|
+
FORMATTED_VALUE = 'FORMATTED_VALUE' # Calculated & formatted according to the cell's formatting. DEFAULT value.
|
|
12
|
+
UNFORMATTED_VALUE = 'UNFORMATTED_VALUE' # Calculated, not formatted (e.g. 123.45 instead of $123.45).
|
|
13
|
+
FORMULA = 'FORMULA' # The formula as entered in the cell, e.g. '=SUM(A1:B1)'. If the cell contains a formula, this field will start with an '=' sign.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class DateTimeRenderOption(StrEnum):
|
|
17
|
+
SERIAL_NUMBER = 'SERIAL_NUMBER' # A number, where 1 corresponds to December 30, 1899. DEFAULT value.
|
|
18
|
+
FORMATTED_STRING = 'FORMATTED_STRING' # A string, formatted according to the cell's formatting.
|
|
7
19
|
|
|
8
20
|
|
|
9
21
|
class ThemeColorType(StrEnum):
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-google-sheets
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: A lightweight and efficient Python wrapper for the Google Sheets API v4
|
|
5
5
|
Author-email: Timofey Egorov <timegorr@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Timofey28/python-google-sheets
|
|
8
|
+
Project-URL: Issues, https://github.com/Timofey28/python-google-sheets/issues
|
|
9
|
+
Keywords: spreadsheets,google-spreadsheets,google-sheets,api,wrapper,python,pydantic
|
|
7
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
8
15
|
Classifier: Operating System :: OS Independent
|
|
9
16
|
Requires-Python: >=3.11
|
|
10
17
|
Description-Content-Type: text/markdown
|
|
@@ -81,7 +88,7 @@ spreadsheet_id, url = GoogleSheets.create_spreadsheet(
|
|
|
81
88
|
)
|
|
82
89
|
```
|
|
83
90
|
|
|
84
|
-
### `update_spreadsheet(spreadsheet_id: str, api_requests: list[dict], service: 'Resource') -> None`
|
|
91
|
+
### `update_spreadsheet(spreadsheet_id: str, api_requests: list[dict], *, service: 'Resource') -> None`
|
|
85
92
|
Execute a `batchUpdate` with one or more request objects.
|
|
86
93
|
|
|
87
94
|
```python
|
|
@@ -93,7 +100,7 @@ requests = [
|
|
|
93
100
|
GoogleSheets.update_spreadsheet(spreadsheet_id, requests, service)
|
|
94
101
|
```
|
|
95
102
|
|
|
96
|
-
### `copy_sheet(source_spreadsheet_id: str, source_sheet_id: str, destination_spreadsheet_id: str, service: 'Resource') -> SheetProperties`
|
|
103
|
+
### `copy_sheet(source_spreadsheet_id: str, source_sheet_id: str, destination_spreadsheet_id: str, *, service: 'Resource') -> SheetProperties`
|
|
97
104
|
Copy a sheet from one spreadsheet into another.
|
|
98
105
|
|
|
99
106
|
```python
|
|
@@ -113,19 +120,39 @@ spreadsheet = GoogleSheets.get_spreadsheet(spreadsheet_id, service)
|
|
|
113
120
|
print([sheet.properties.title for sheet in spreadsheet.sheets])
|
|
114
121
|
```
|
|
115
122
|
|
|
116
|
-
### `get_spreadsheet_range_values(spreadsheet_id: str, sheets: list[str | int], ranges: list[list[str]], service: 'Resource') -> list[list[
|
|
117
|
-
|
|
123
|
+
### `get_spreadsheet_range_values(spreadsheet_id: str, sheets: list[str | int] | str | int, ranges: list[list[str]] | list[str] | str, *, by_columns: bool = False, service: 'Resource') -> list[list[RangeData]] | None:`
|
|
124
|
+
Reads values from multiple ranges across multiple sheets. Returns a matrix of values (RangeData - list[list[SimpleType]]) for each range of each sheet. Returns None if an error occurs.
|
|
125
|
+
|
|
126
|
+
Code from this example returns one range from sheet with id `1601337967` and three ranges from sheet `Summary` (assuming that these sheets exist in the spreadsheet). You can mix and match sheet names and ids as needed.
|
|
118
127
|
|
|
119
128
|
```python
|
|
120
129
|
values = GoogleSheets.get_spreadsheet_range_values(
|
|
121
|
-
spreadsheet_id=
|
|
122
|
-
sheets=[
|
|
123
|
-
ranges=[['A2:
|
|
124
|
-
service=service
|
|
130
|
+
spreadsheet_id=SPREADSHEET_ID,
|
|
131
|
+
sheets=[1601337967, 'Summary'],
|
|
132
|
+
ranges=[['A2:C100'], ['A1:E10', 'F1:F10', 'H1']],
|
|
133
|
+
service=service
|
|
125
134
|
)
|
|
126
|
-
print(values)
|
|
127
135
|
```
|
|
128
136
|
|
|
137
|
+
Next two examples return the same data (assuming that sheet `Sheet1` exists and has id `0`). With `by_columns=True` the values are grouped by columns instead of rows.
|
|
138
|
+
```python
|
|
139
|
+
values = GoogleSheets.get_spreadsheet_range_values(
|
|
140
|
+
SPREADSHEET_ID,
|
|
141
|
+
sheets='Sheet1',
|
|
142
|
+
ranges=['A1:E5'],
|
|
143
|
+
by_columns=True,
|
|
144
|
+
service=service
|
|
145
|
+
)
|
|
146
|
+
```
|
|
147
|
+
```python
|
|
148
|
+
values = GoogleSheets.get_spreadsheet_range_values(
|
|
149
|
+
SPREADSHEET_ID,
|
|
150
|
+
sheets=0,
|
|
151
|
+
ranges='A1:E5',
|
|
152
|
+
by_columns=True,
|
|
153
|
+
service=service
|
|
154
|
+
)
|
|
155
|
+
```
|
|
129
156
|
---
|
|
130
157
|
|
|
131
158
|
## `ApiRequest` methods for `batchUpdate`
|
|
@@ -154,7 +181,7 @@ req = ApiRequest.update_cells(
|
|
|
154
181
|
---
|
|
155
182
|
### Conditional formatting
|
|
156
183
|
|
|
157
|
-
### `add_boolean_format_rule(
|
|
184
|
+
### `add_boolean_format_rule(sheet_id: int, ranges: list[str], condition_type: ConditionType, *, condition_values: list[ConditionValue] = None, cell_format: CellFormat) -> dict`
|
|
158
185
|
Add a rule (for example, highlight values greater than `100`).
|
|
159
186
|
|
|
160
187
|
```python
|
|
@@ -172,7 +199,7 @@ req = ApiRequest.add_boolean_format_rule(
|
|
|
172
199
|
)
|
|
173
200
|
```
|
|
174
201
|
|
|
175
|
-
### `GradientRule.add(
|
|
202
|
+
### `GradientRule.add(sheet_id: int, *, ranges: list[str], interpolation_points: tuple[IPTypeAndValue, IPTypeAndValue] | tuple[IPTypeAndValue, IPTypeAndValue, IPTypeAndValue], interpolation_point_colors: tuple[ColorStyle, ColorStyle] | tuple[ColorStyle, ColorStyle, ColorStyle]) -> dict`
|
|
176
203
|
Add a custom color scale with 2 or 3 interpolation points.
|
|
177
204
|
|
|
178
205
|
```python
|
|
@@ -194,7 +221,7 @@ req = ApiRequest.GradientRule.add(
|
|
|
194
221
|
)
|
|
195
222
|
```
|
|
196
223
|
|
|
197
|
-
### `GradientRule.add_preset(
|
|
224
|
+
### `GradientRule.add_preset(sheet_id: int, ranges: list[str], preset: Preset) -> dict`
|
|
198
225
|
Add a gradient rule from a built-in preset.
|
|
199
226
|
|
|
200
227
|
```python
|
|
@@ -205,14 +232,14 @@ req = ApiRequest.GradientRule.add_preset(
|
|
|
205
232
|
)
|
|
206
233
|
```
|
|
207
234
|
|
|
208
|
-
### `delete_conditional_format_rule(
|
|
235
|
+
### `delete_conditional_format_rule(sheet_id: int, *, index: int) -> dict`
|
|
209
236
|
Delete a conditional format rule by index.
|
|
210
237
|
|
|
211
238
|
```python
|
|
212
239
|
req = ApiRequest.delete_conditional_format_rule(sheet_id=0, index=0)
|
|
213
240
|
```
|
|
214
241
|
|
|
215
|
-
### `update_conditional_format_rule(
|
|
242
|
+
### `update_conditional_format_rule(sheet_id: int, *, index: int, rule: ConditionalFormatRule) -> dict`
|
|
216
243
|
Replace an existing conditional format rule by index.
|
|
217
244
|
|
|
218
245
|
```python
|
|
@@ -300,7 +327,7 @@ Delete a sheet.
|
|
|
300
327
|
req = ApiRequest.delete_sheet(sheet_id=3)
|
|
301
328
|
```
|
|
302
329
|
|
|
303
|
-
### `add_sheet(
|
|
330
|
+
### `add_sheet(sheet_id: int = None, *, title: str = None, index: int = None, hidden: bool = None, row_count: int = None, column_count: int = None, frozen_row_count: int = None, frozen_column_count: int = None, hide_grid_lines: bool = None) -> dict`
|
|
304
331
|
Create a new sheet with optional properties.
|
|
305
332
|
|
|
306
333
|
```python
|
|
@@ -322,7 +349,7 @@ Merge cells in a range.
|
|
|
322
349
|
req = ApiRequest.merge_cells(sheet_id=0, range_='A1:C1')
|
|
323
350
|
```
|
|
324
351
|
|
|
325
|
-
### `unmerge_cells(sheet_id: int, range_: str = None, start_row: int = None, end_row: int = None, start_column: int | str = None, end_column: int | str = None) -> dict`
|
|
352
|
+
### `unmerge_cells(sheet_id: int, *, range_: str = None, start_row: int = None, end_row: int = None, start_column: int | str = None, end_column: int | str = None) -> dict`
|
|
326
353
|
Unmerge cells in a range (or by explicit indexes).
|
|
327
354
|
|
|
328
355
|
```python
|
|
@@ -339,14 +366,14 @@ req = ApiRequest.freeze(sheet_id=0, rows=1, columns=1)
|
|
|
339
366
|
---
|
|
340
367
|
### Rows and columns
|
|
341
368
|
|
|
342
|
-
### `insert_rows(sheet_id: int, start_index: int, end_index: int = None, inherit_from_before: bool = True) -> dict`
|
|
369
|
+
### `insert_rows(sheet_id: int, start_index: int, end_index: int = None, *, inherit_from_before: bool = True) -> dict`
|
|
343
370
|
Insert one or more rows (Indexes are zero-based and inclusive [start_index, end_index]).
|
|
344
371
|
|
|
345
372
|
```python
|
|
346
373
|
req = ApiRequest.insert_rows(sheet_id=0, start_index=5, end_index=9)
|
|
347
374
|
```
|
|
348
375
|
|
|
349
|
-
### `insert_columns(sheet_id: int, start_index: int, end_index: int = None, inherit_from_before: bool = True) -> dict`
|
|
376
|
+
### `insert_columns(sheet_id: int, start_index: int, end_index: int = None, *, inherit_from_before: bool = True) -> dict`
|
|
350
377
|
Insert columns (Indexes are zero-based and inclusive [start_index, end_index]).
|
|
351
378
|
|
|
352
379
|
```python
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
google_sheets/__init__.py,sha256=ZhBNb6oS2tyliSe89Vc0Kw0DSxLMArl3GIMQNf1qsKo,850
|
|
2
|
-
google_sheets/api_request.py,sha256=
|
|
3
|
-
google_sheets/google_sheets.py,sha256=
|
|
2
|
+
google_sheets/api_request.py,sha256=MJ14qQ8j4LVXxXGl80nhzep4WN76gcyLoZC8QSvy6DE,26470
|
|
3
|
+
google_sheets/google_sheets.py,sha256=uJBdCoFNFSFl-zQIhKm9JT7y3IL8tjvwUXdUNysNpMw,8886
|
|
4
4
|
google_sheets/styles.py,sha256=9n-4W8EW8F62JxPCL99uctNVv3j703wO2UqoAGWoylo,13418
|
|
5
5
|
google_sheets/utils.py,sha256=hmqVC75t2Q4lTztKKxerWar7B_HQnrmO2EGhbesdkNU,1695
|
|
6
|
-
google_sheets/spreadsheet_requests/__init__.py,sha256=
|
|
6
|
+
google_sheets/spreadsheet_requests/__init__.py,sha256=ygiBT-2Rg67DEULY24NcAjFfSUR9IrCedLQz47LjXcs,1398
|
|
7
7
|
google_sheets/spreadsheet_requests/conditional_format_rule.py,sha256=wCN37BBWnoitXifcl9ni0KlPKxuKEwIVOnt7Z2n6DcE,6775
|
|
8
8
|
google_sheets/spreadsheet_requests/dimension.py,sha256=CLKyPsEvoQXGCYky_FLU3CBOlAr8qkLVZaKDzng703g,2952
|
|
9
|
-
google_sheets/spreadsheet_requests/general_models.py,sha256=
|
|
9
|
+
google_sheets/spreadsheet_requests/general_models.py,sha256=1hq157SuycJ_9bC84lfLajRiL8vkLPMwGc-b-wOBON0,3484
|
|
10
10
|
google_sheets/spreadsheet_requests/merge_cells.py,sha256=Y7ChGjmb07jCCG1aP2Ws126cq2AXfhF4rwqskvrTv0w,1023
|
|
11
11
|
google_sheets/spreadsheet_requests/spreadsheet.py,sha256=lUMhrIpo_YOiPEbzgwONeSx4GDaeSn928R83qHcj7F8,3706
|
|
12
12
|
google_sheets/spreadsheet_requests/update_cells.py,sha256=cOLcDKp4pgj6xgzoWOJXCO8IlmK_htweX-6WzNka9TM,9159
|
|
13
13
|
google_sheets/spreadsheet_requests/update_sheet_properties.py,sha256=Gvmrc2SV3UCBF40mJCsAQaOKppA_C53dp8LYrRaisfM,1830
|
|
14
|
-
python_google_sheets-1.
|
|
15
|
-
python_google_sheets-1.
|
|
16
|
-
python_google_sheets-1.
|
|
17
|
-
python_google_sheets-1.
|
|
18
|
-
python_google_sheets-1.
|
|
14
|
+
python_google_sheets-1.2.0.dist-info/licenses/LICENSE,sha256=2PFWLbALHdUFzFd2QtLQvu7Ku4M6IO53Ns6b892nVvg,1090
|
|
15
|
+
python_google_sheets-1.2.0.dist-info/METADATA,sha256=eu_uK-kaX_Ygb-wZ3g52w87RYcoiWbR3X4EL9IyOIyo,17740
|
|
16
|
+
python_google_sheets-1.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
17
|
+
python_google_sheets-1.2.0.dist-info/top_level.txt,sha256=AEiUl4h4VXrqsRO0AiL9C7ArYqmDhVuz--b035K3r34,14
|
|
18
|
+
python_google_sheets-1.2.0.dist-info/RECORD,,
|
|
File without changes
|
{python_google_sheets-1.1.0.dist-info → python_google_sheets-1.2.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|