Search code examples
pythongoogle-sheets

Is this possible - Python script to fill a Google spreadsheet?


I dont even know if this is possible. But if it is, can someone give me the broadstrokes on how I can use a Python script to populate a Google spreadsheet?

I want to scrape data from a web site and dump it into a google spreadsheet. I can imagine what the Python looks like (scrapy, etc). But does the language support writing to Google Drive? Can I kick off the script within the spreadsheet itself or would it have to run outside of it?

Ideal scenario would be to open a google spreadsheet, click on a button, Python script executes and data is filled in said spreadsheet.


Solution

  • Google GData (library with interfaces for all Google services) Python client:

    https://code.google.com/p/gdata-python-client/

    Spreadsheets API docs (linked from previous page):

    https://developers.google.com/google-apps/spreadsheets/?csw=1