Use DriveBot to upload a document to your Google Drive#

This example shows how to instantiate a drivebot authenticating through a web interface and upload a simple document.

Configuration#

The first time you use a DriveBot you probably want to use a web interface to authenticate. If you save your credentials (this will be saved in the .tokens folder) you don’t have to do it again: just set authentication=’local when you instantiate your bot.

In action#

this is an example implementation:

from codebots.bots import DriveBot

# create a DriveBot using a web authentication and store the credentials
dbot = DriveBot('web', True)

dbot.create_and_upload(name='my_first_upload.txt',
                       content='codebots is awesome!')