Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install pydrive

How to install PyDrive

  1. Download and install ActivePython
  2. Buy and install the Business Edition license from account.activestate.com
  3. Open Command Prompt
  4. Type pypm install pydrive

PyDrive contains builds that are only available via PyPM when you have a current ActivePython Business Edition subscription.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4.2
0.5.0Never BuiltWhy not?
0.4.2 Available View build log
0.3.0 Available View build log
0.2.1 Available View build log
Windows (64-bit)
0.3.0
0.5.0Never BuiltWhy not?
0.3.0 Available View build log
0.2.1 Available View build log
Mac OS X (10.5+)
0.4.2
0.5.0Never BuiltWhy not?
0.4.2 Available View build log
0.3.0 Available View build log
0.2.1 Available View build log
Linux (32-bit)
0.5.0
0.5.0 Available View build log
0.4.2 Available View build log
0.3.0 Available View build log
0.2.1 Available View build log
Linux (64-bit)
0.5.0
0.5.0 Available View build log
0.4.2 Available View build log
0.3.0 Available View build log
0.2.1 Available View build log
 
Author
License
LICENSE
Imports
Lastest release
version 1.0.0 on Jan 9th, 2014

PyDrive

PyDrive is a wrapper library of google-api-python-client that simplifies many common Google Drive API tasks.

Features of PyDrive

  • Simplifies OAuth2.0 into just few lines with flexible settings.
  • Wraps Google Drive API into classes of each resource to make your program more object-oriented.
  • Helps common operations else than API calls, such as content fetching and pagination control.

How to install

You can install PyDrive with regular pip command.

$ pip install PyDrive

OAuth made easy

Download client_secrets.json from Google API Console and OAuth2.0 is done in two lines. You can customize behavior of OAuth2 in one settings file settings.yaml.

System Message: ERROR/3 (<string>, line 40)

Unknown directive type "code".

.. code:: python


    from pydrive.auth import GoogleAuth
    from pydrive.drive import GoogleDrive

    gauth = GoogleAuth()
    gauth.LocalWebserverAuth()

    drive = GoogleDrive(gauth)

File management made easy

Upload/update the file with one method. PyDrive will do it in the most efficient way.

System Message: ERROR/3 (<string>, line 57)

Unknown directive type "code".

.. code:: python

    file1 = drive.CreateFile({'title': 'Hello.txt'})
    file1.SetContentString('Hello')
    file1.Upload() # Files.insert()

    file1['title'] = 'HelloWorld.txt'  # Change title of the file
    file1.Upload() # Files.patch()

    content = file1.GetContentString()  # 'Hello'
    file1.SetContentString(content+' World!')  # 'Hello World!'
    file1.Upload() # Files.update()

    file2 = drive.CreateFile()
    file2.SetContentFile('hello.png')
    file2.Upload()
    print 'Created file %s with mimeType %s' % (file2['title'], file2['mimeType'])
    # Created file hello.png with mimeType image/png

    file3 = drive.CreateFile({'id': file2['id']})
    print 'Downloading file %s from Google Drive' % file3['title'] # 'hello.png'
    file3.GetContentFile('world.png')  # Save Drive file as a local file

File listing pagination made easy

PyDrive handles file listing pagination for you.

System Message: ERROR/3 (<string>, line 85)

Unknown directive type "code".

.. code:: python

    # Auto-iterate through all files that matches this query
    file_list = drive.ListFile({'q': "'root' in parents"}).GetList()
    for file1 in file_list:
      print 'title: %s, id: %s' % (file1['title'], file1['id'])

    # Paginate file lists by specifying number of max results
    for file_list in drive.ListFile({'maxResults': 10}):
      print 'Received %s files from Files.list()' % len(file_list) # <= 10
      for file1 in file_list:
        print 'title: %s, id: %s' % (file1['title'], file1['id'])

Subscribe to package updates

Last updated Jan 9th, 2014

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.