class GoogleSheet(key_file, url, col_list_suffix='_list', col_list_delim=',', col_date_suffix='_date', col_date_format='%Y-%m-%d', verbose=False)[source]

Bases: object

Utility class able to convert a remote Google Spreadsheet file into a pandas.DataFrame. Each sheet is converted to a separate pandas.DataFrame accessible by class attribute.

  • key_file (str) – Authentication key to access spreadsheets via Google Sheets API

  • url (str) – Complete URL referring to a Google Spreadsheet file (public accessible).

  • col_list_suffix (str) – All the columns with this suffix are converted to a list of strings.

  • col_list_delim (str) – Text delimiter used to separate the list elements.

  • col_date_suffix (str) – All the columns with this suffix are converted to a date object.

  • col_date_format (str) – Date format used to convert string values in date object.

  • verbose (bool) – Use True to print the progress of all steps.


>>> # Generate your key follow the instructions in
>>> key_file = '<GDRIVE_KEY>'
>>> # Public accessible Google Spreadsheet (Anyone on the internet with this link can view)
>>> url = ''
>>> gsheet = GoogleSheet(key_file, url)
>>> print('Sheet points_nl: ', gsheet.points_nl.shape)
>>> print('Sheet tiles: ', gsheet.tiles.shape)