Python Forum
Access google sheets like a csv file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access google sheets like a csv file
#1
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
Reply
#2
Thanks for sharing!
Reply
#3
Why do you use comments instead of __doc___?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#4
(Jan-16-2017, 06:18 PM)wavic Wrote: Why do you use comments instead of __doc___?
Could you elaborate?
Reply
#5
Hm! It's nothing. These are not functions definitions.  Dodgy

I was almost asleep  Cool
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#6
(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+ !!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020