gspread/models.py
def range(self, name):
        """Returns a list of :class:`Cell` objects from a specified range.

        :param name: A string with range value in A1 notation (e.g. 'A1:A5')
                     or the named range to fetch.
        :type name: str

        Alternatively, you may specify numeric boundaries. All values
        index from 1 (one):

        :param int first_row: First row number
        :param int first_col: First column number
        :param int last_row: Last row number
        :param int last_col: Last column number

        Example::

            >>> # Using A1 notation
            >>> worksheet.range('A1:B7')
            [<Cell R1C1 "42">, ...]

            >>> # Same with numeric boundaries
            >>> worksheet.range(1, 1, 7, 2)
            [<Cell R1C1 "42">, ...]

            >>> # Named ranges work as well
            >>> worksheet.range('NamedRange')
            [<Cell R1C1 "42">, ...]
        """
        range_label = absolute_range_name(self.title, name)

        data = self.spreadsheet.values_get(range_label)

        start = None
        end = None

        if ':' not in name:
            range_name = data.get('range', None)
            if range_name and '!' in range_name:
                coordinates = range_name.split('!')[1]
                if ':' in coordinates:
                    start, end = coordinates.split(':')
            if not start or not end:
                raise ValueError('Cannot retrieve range coordinates')
        else:
            start, end = name.split(':')

        (row_offset, column_offset) = a1_to_rowcol(start)
        (last_row, last_column) = a1_to_rowcol(end)

        values = data.get('values', [])

        rect_values = fill_gaps(
            values,
            rows=last_row - row_offset + 1,
            cols=last_column - column_offset + 1,
        )

        return [
            Cell(row=i + row_offset, col=j + column_offset, value=value)
            for i, row in enumerate(rect_values)
            for j, value in enumerate(row)
        ]
Returns a list of :class:`Cell` objects from a specified range.

        :param name: A string with range value in A1 notation (e.g. 'A1:A5')
                     or the named range to fetch.
        :type name: str

        Alternatively, you may specify numeric boundaries. All values
        index from 1 (one):

        :param int first_row: First row number
        :param int first_col: First column number
        :param int last_row: Last row number
        :param int last_col: Last column number

        Example::

            >>> # Using A1 notation
            >>> worksheet.range('A1:B7')
            [<Cell R1C1 "42">, ...]

            >>> # Same with numeric boundaries
            >>> worksheet.range(1, 1, 7, 2)
            [<Cell R1C1 "42">, ...]

            >>> # Named ranges work as well
            >>> worksheet.range('NamedRange')
            [<Cell R1C1 "42">, ...]
        
Returns a list of :class:`Cell` objects from a specified range.
Returns a list of : class : ` Cell ` objects from a specified range .
def range(self, name):
        range_label = absolute_range_name(self.title, name)
        data = self.spreadsheet.values_get(range_label)
        start = None
        end = None
        if ':' not in name:
            range_name = data.get('range', None)
            if range_name and '!' in range_name:
                coordinates = range_name.split('!')[1]
                if ':' in coordinates:
                    start, end = coordinates.split(':')
            if not start or not end:
                raise ValueError('Cannot retrieve range coordinates')
        else:
            start, end = name.split(':')
        (row_offset, column_offset) = a1_to_rowcol(start)
        (last_row, last_column) = a1_to_rowcol(end)
        values = data.get('values', [])
        rect_values = fill_gaps(
            values,
            rows=last_row - row_offset + 1,
            cols=last_column - column_offset + 1,
        )
        return [
            Cell(row=i + row_offset, col=j + column_offset, value=value)
            for i, row in enumerate(rect_values)
            for j, value in enumerate(row)
        ]
def range ( self , name ) : range_label = absolute_range_name ( self . title , name ) data = self . spreadsheet . values_get ( range_label ) start = None end = None if ':' not in name : range_name = data . get ( 'range' , None ) if range_name and '!' in range_name : coordinates = range_name . split ( '!' ) [ 1 ] if ':' in coordinates : start , end = coordinates . split ( ':' ) if not start or not end : raise ValueError ( 'Cannot retrieve range coordinates' ) else : start , end = name . split ( ':' ) ( row_offset , column_offset ) = a1_to_rowcol ( start ) ( last_row , last_column ) = a1_to_rowcol ( end ) values = data . get ( 'values' , [ ] ) rect_values = fill_gaps ( values , rows = last_row - row_offset + 1 , cols = last_column - column_offset + 1 , ) return [ Cell ( row = i + row_offset , col = j + column_offset , value = value ) for i , row in enumerate ( rect_values ) for j , value in enumerate ( row ) ]
Returns a list of :class:`Cell` objects from a specified range.
Returns a list of : class : ` Cell ` objects from a specified range .
"""Returns a list of :class:`Cell` objects from a specified range.

        :param name: A string with range value in A1 notation (e.g. 'A1:A5')
                     or the named range to fetch.
        :type name: str

        Alternatively, you may specify numeric boundaries. All values
        index from 1 (one):

        :param int first_row: First row number
        :param int first_col: First column number
        :param int last_row: Last row number
        :param int last_col: Last column number

        Example::

            >>> # Using A1 notation
            >>> worksheet.range('A1:B7')
            [<Cell R1C1 "42">, ...]

            >>> # Same with numeric boundaries
            >>> worksheet.range(1, 1, 7, 2)
            [<Cell R1C1 "42">, ...]

            >>> # Named ranges work as well
            >>> worksheet.range('NamedRange')
            [<Cell R1C1 "42">, ...]
        """
self
name
A string with range value in A1 notation
or the named range to fetch.
A string with range value in A1 notation or the named range to fetch .
first_row
First row number
First row number
first_col
First column number
First column number
last_row
Last row number
Last row number
last_col
Last column number
Example:.





>>> # Named ranges work as well
>>> worksheet.range('NamedRange')
[, ...]
Last column number Example : . >>> # Named ranges work as well >>> worksheet . range ( ' NamedRange ' ) [ ... ]