DataRange

class pygsheets.DataRange(start=None, end=None, worksheet=None, name='', data=None, name_id=None, namedjson=None)[source]

DataRange specifes a range of cells in the sheet

Parameters:
  • start – top left cell adress
  • end – bottom right cell adress
  • worksheet – worksheet where this range belongs
  • name – name of the named range
  • name_id – id of named range
  • namedjson – json representing the NamedRange from api
name

name of the named range, setting a name will make this a range a named range setting this to ‘’ will delete the named range

protect

(boolean) if this range is protected

start_addr

topleft adress of the range

end_addr

bottomright adress of the range

range

Range in format A1:C5

link the dstarange so that all propertis are synced right after setting them

Parameters:update – if the range should be synced to cloud on link

unlink the sheet so that all properties are not synced as its changed

fetch(only_data=True)[source]

update the range data/ properties from cloud

Parameters:only_data – fetch only data
applay_format(cell)[source]

Change format of all cells in the range

Parameters:cell – a model :class: Cell whose format will be applied to all cells
update_values(values=None)[source]

Update the values of the cells in this range

Parameters:values – values as matrix
update_named_range()[source]

update the named properties