Reads values of a single range or a cell of a sheet. Returns a ValueRange (list of lists) containing all values from a specified range or cell By default values are returned as strings. See ``value_render_option`` to change the default format. :param str range_name
(
self,
range_name: Optional[str] = None,
major_dimension: Optional[Dimension] = None,
value_render_option: Optional[ValueRenderOption] = None,
date_time_render_option: Optional[DateTimeOption] = None,
combine_merged_cells: bool = False,
maintain_size: bool = False,
pad_values: bool = False,
return_type: GridRangeType = GridRangeType.ValueRange,
)
| 824 | return data |
| 825 | |
| 826 | def get( |
| 827 | self, |
| 828 | range_name: Optional[str] = None, |
| 829 | major_dimension: Optional[Dimension] = None, |
| 830 | value_render_option: Optional[ValueRenderOption] = None, |
| 831 | date_time_render_option: Optional[DateTimeOption] = None, |
| 832 | combine_merged_cells: bool = False, |
| 833 | maintain_size: bool = False, |
| 834 | pad_values: bool = False, |
| 835 | return_type: GridRangeType = GridRangeType.ValueRange, |
| 836 | ) -> Union[ValueRange, List[List[str]]]: |
| 837 | """Reads values of a single range or a cell of a sheet. |
| 838 | |
| 839 | Returns a ValueRange (list of lists) containing all values from a specified range or cell |
| 840 | |
| 841 | By default values are returned as strings. See ``value_render_option`` |
| 842 | to change the default format. |
| 843 | |
| 844 | :param str range_name: (optional) Cell range in the A1 notation or |
| 845 | a named range. If not specified the method returns values from all non empty cells. |
| 846 | |
| 847 | :param str major_dimension: (optional) The major dimension of the |
| 848 | values. `Dimension.rows` ("ROWS") or `Dimension.cols` ("COLUMNS"). |
| 849 | Defaults to Dimension.rows |
| 850 | :type major_dimension: :class:`~gspread.utils.Dimension` |
| 851 | |
| 852 | :param value_render_option: (optional) Determines how values should |
| 853 | be rendered in the output. See `ValueRenderOption`_ in |
| 854 | the Sheets API. |
| 855 | |
| 856 | Possible values are: |
| 857 | |
| 858 | ``ValueRenderOption.formatted`` |
| 859 | (default) Values will be calculated and formatted according |
| 860 | to the cell's formatting. Formatting is based on the |
| 861 | spreadsheet's locale, not the requesting user's locale. |
| 862 | |
| 863 | ``ValueRenderOption.unformatted`` |
| 864 | Values will be calculated, but not formatted in the reply. |
| 865 | For example, if A1 is 1.23 and A2 is =A1 and formatted as |
| 866 | currency, then A2 would return the number 1.23. |
| 867 | |
| 868 | ``ValueRenderOption.formula`` |
| 869 | Values will not be calculated. The reply will include |
| 870 | the formulas. For example, if A1 is 1.23 and A2 is =A1 and |
| 871 | formatted as currency, then A2 would return "=A1". |
| 872 | |
| 873 | .. _ValueRenderOption: https://developers.google.com/sheets/api/reference/rest/v4/ValueRenderOption |
| 874 | |
| 875 | :type value_render_option: :class:`~gspread.utils.ValueRenderOption` |
| 876 | |
| 877 | :param str date_time_render_option: (optional) How dates, times, and |
| 878 | durations should be represented in the output. |
| 879 | |
| 880 | Possible values are: |
| 881 | |
| 882 | ``DateTimeOption.serial_number`` |
| 883 | (default) Instructs date, time, datetime, and duration fields |