A simple, intutive library for google spreadsheets based on api v4 which gets most of your work done.


  • Google spreadsheet api v4 support
  • Open, create, delete and share spreadsheets using _title_
  • Control permissions of spreadsheets.
  • Extract range, entire row or column values.
  • Set cell format, text format, coloe, write notes
  • NamedRanges Support
  • Do all the updates and push the changes in a batch

Small Example

Sample scenario : you want to share a numpy array with your remote friend

import pygsheets

gc = pygsheets.authorize()

# Open spreadsheet and then workseet
sh ='my new ssheet')
wks = sh.sheet1

# Update a cell with value (just to let him know values is updated ;) )
wks.update_cell('A1', "Hey yank this numpy array")

# update the sheet with array
wks.update_cells('A2', my_nparray.to_list())

# share the sheet with your friend

Sample scenario: you want to store students name and their heights

## import and open the sheet as given above

header = wks.cell('A1')
header.value = 'Names'
header.text_format['bold'] = True # make the header bold

# or achive the same in oneliner
wks.cell('B1').set_text_format('bold', True).value = 'heights'

# set the names

# set the heights
heights = wks.range('B2:B5')  # get the range = "heights"  # name the range
heights.update_values([[50],[60],[67],[66]]) # update the vales
wks.update_cell('B6','=average(heights)') # set get the avg value


pip install (recent)
pip install pygsheets (stable)


There are mainly 4 models - spreadsheet, worksheet, cell, DataRange they are defined in their respectivr files. The communication with google api is implimented in The also impliments the autorization functions.

Authors and License

The pygsheets package is written by Nithin Murali and is inspried by gspread. It’s MIT licensed and freely available.

Feel free to improve this package and send a pull request to GitHub.


Indices and tables