Python Forum

Full Version: Access google sheets like a csv file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

    I wrote a python library for accessing google sheets based on google's new sheet api v4, named pygsheets.

    Its well documented and is much more intutive than the google client.
    Checkout a small use case  you want to share a numpy array with your remote friend 

import pygsheets

gc = pygsheets.authorize()

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

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

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

# share the sheet with your friend
sh.share("[email protected]")
     More at : http://github.com/nithinmurali/pygsheets

     Any contributions are welcome :)
     Its based on another library which uses api v3 - gspread
Thanks for sharing!
Why do you use comments instead of __doc___?
(Jan-16-2017, 06:18 PM)wavic Wrote: [ -> ]Why do you use comments instead of __doc___?
Could you elaborate?
Hm! It's nothing. These are not functions definitions.  Dodgy

I was almost asleep  Cool
(Jan-16-2017, 06:19 PM)micseydel Wrote: [ -> ]
(Jan-16-2017, 06:18 PM)wavic Wrote: [ -> ]Why do you use comments instead of __doc___?
Could you elaborate?

 Hmmm I briefly checked out the source of github but I imagine wavic is referring to usin "_doc_" in order """ tags used in you pyScipts to indicate the associations the they have with each other? @wavic  Would I be right to say so? Can't see any other explanation lol ... Your code is squeaky clean as far as I saw, following PEP-* guidelines should be used at nauseum just because it establishes the habit to write industry standard but I say abstraction is beauty, what matter most is logic flow... unless your being paid for or having a project open-sourced with intend of having contributes for further "extension-ability"... what matter to me the most is that I can just see the source and follow logic... however it may be implemented.
  Then again I have no reservations when even writing everyday plain text in my bastardized. way outdated l33t jargon/sms speak... at the detriment sounding illiterate ... almost at every post lol

@prettybug .. this projects is awesome! thanks for the share! forked+ !!