This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A python3 compatible fork of mbrenig/SheetSync.

A python library to create, update and delete rows of data in a google spreadsheet. Click here to read the full documentation.


Install from PyPi using pip:

pip install sheetsync3

Or you can clone the git repo and install from the code:

git clone sheetsync3
pip install sheetsync3

Note, you may need to run the commands above with sudo.

Setting up OAuth 2.0 access

The Google Drive API now requires the use of OAuth2.0. This means you will need to go through a bit of configuration to get an API Client ID and Client Secret before using sheetsync.

Read the step-by-step getting started guide for instructions.

Injecting data to a Google sheet

SheetSync works with data in a dictionary of dictionaries. Each row is represented by a dictionary, and these are themselves stored in a dictionary indexed by a row-specific key. For example this dictionary represents two rows of data each with columns “Color” and “Performer”:

data = { "Kermit": {"Color" : "Green", "Performer" : "Jim Henson"},
         "Miss Piggy" : {"Color" : "Pink", "Performer" : "Frank Oz"}

To insert this data (add or update rows) into a target worksheet in a google spreadsheet doc use this code:

import logging
from sheetsync import Sheet, ia_credentials_helper
# Turn on logging so you can see what sheetsync is doing.

# Create OAuth2 credentials, or reload them from a local cache file.
CLIENT_SECRET = 'QJN*****************hk-i'
creds = ia_credentials_helper(CLIENT_ID, CLIENT_SECRET,

data = { "Kermit": {"Color" : "Green", "Performer" : "Jim Henson"},
         "Miss Piggy" : {"Color" : "Pink", "Performer" : "Frank Oz"} }

# Find or create a spreadsheet, then inject data.
target = Sheet(credentials=creds, document_name="sheetsync Getting Started")
print("Spreadsheet created here: {}".format(target.document_href))

The first part of this script imports the Sheet object and ia_credentials_helper function. This function is included to help you quickly generate an OAuth2Credentials object using your Client ID and Secret.

The second part creates a new spreadsheet document in your google drive and then inserts the data like so:

Later on you’ll probably want to access this data, to do that note the spreadsheet’s document key from the URL:

and access the data as follows:

source = Sheet(credentials=creds,

The ‘inject’ method only adds or updates rows. If you want to delete rows from the spreadsheet to keep it in sync with the input data then use the ‘sync’ method.

Full documentation

Is available here.

Testing and development

SheetSync comes with tox tests. To run them, you’ll need to copy the .secret file to .mysecrets and fill in your own Client ID, Secret and Testdoc folder key. Then run with the following two commands:

. .mysecrets

The license is MIT so feel free to edit, improve. Cheers.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting