{"id":13502518,"url":"https://github.com/googlearchive/PyDrive","last_synced_at":"2025-03-29T12:32:06.859Z","repository":{"id":44452169,"uuid":"12164337","full_name":"googlearchive/PyDrive","owner":"googlearchive","description":"Google Drive API Python wrapper library","archived":true,"fork":false,"pushed_at":"2021-06-24T05:24:59.000Z","size":1875,"stargazers_count":1309,"open_issues_count":89,"forks_count":272,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-03-15T12:47:44.808Z","etag":null,"topics":["google-drive","gsuite","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googlearchive.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-16T17:39:54.000Z","updated_at":"2025-03-06T06:58:31.000Z","dependencies_parsed_at":"2022-09-21T16:01:03.638Z","dependency_job_id":null,"html_url":"https://github.com/googlearchive/PyDrive","commit_stats":null,"previous_names":["googledrive/pydrive"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlearchive%2FPyDrive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlearchive%2FPyDrive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlearchive%2FPyDrive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlearchive%2FPyDrive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googlearchive","download_url":"https://codeload.github.com/googlearchive/PyDrive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246186817,"owners_count":20737453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-drive","gsuite","python"],"created_at":"2024-07-31T22:02:16.618Z","updated_at":"2025-03-29T12:32:06.378Z","avatar_url":"https://github.com/googlearchive.png","language":"Python","readme":"Deprecated\n----------\n\nThis project is deprecated and no longer maintained. No further changes will be made.\n\nIn one of the PyDrive `issues \u003chttps://github.com/googleworkspace/PyDrive/issues/199\u003e`_, we learned about the `PyDrive2 \u003chttps://github.com/iterative/PyDrive2\u003e`_ fork of PyDrive. Forks are permitted under PyDrive's `license \u003cLICENSE\u003e`_, and we hope that such forks will be useful for the needs of PyDrive users. The PyDrive team makes no endorsement or support promises of any particular fork, but we're excited to see the open source license being a vehicle for new project development.\n\n\nPyDrive\n-------\n\n*PyDrive* is a wrapper library of\n`google-api-python-client \u003chttps://github.com/google/google-api-python-client\u003e`_\nthat simplifies many common Google Drive API tasks.\n\nProject Info\n------------\n\n- Homepage: `https://pypi.python.org/pypi/PyDrive \u003chttps://pypi.python.org/pypi/PyDrive\u003e`_\n- Documentation: `Official documentation on GitHub pages \u003chttps://googleworkspace.github.io/PyDrive/docs/build/html/index.html\u003e`_\n- GitHub: `https://github.com/googleworkspace/PyDrive \u003chttps://github.com/googleworkspace/PyDrive\u003e`_\n\nFeatures of PyDrive\n-------------------\n\n-  Simplifies OAuth2.0 into just few lines with flexible settings.\n-  Wraps `Google Drive API \u003chttps://developers.google.com/drive/\u003e`_ into\n   classes of each resource to make your program more object-oriented.\n-  Helps common operations else than API calls, such as content fetching\n   and pagination control.\n\nHow to install\n--------------\n\nYou can install PyDrive with regular ``pip`` command.\n\n::\n\n    $ pip install PyDrive\n\nTo install the current development version from GitHub, use:\n\n::\n\n    $  pip install git+https://github.com/googleworkspace/PyDrive.git#egg=PyDrive\n\nOAuth made easy\n---------------\n\nDownload *client\\_secrets.json* from Google API Console and OAuth2.0 is\ndone in two lines. You can customize behavior of OAuth2 in one settings\nfile *settings.yaml*.\n\n.. code:: python\n\n\n    from pydrive.auth import GoogleAuth\n    from pydrive.drive import GoogleDrive\n\n    gauth = GoogleAuth()\n    gauth.LocalWebserverAuth()\n\n    drive = GoogleDrive(gauth)\n\nFile management made easy\n-------------------------\n\nUpload/update the file with one method. PyDrive will do it in the most\nefficient way.\n\n.. code:: python\n\n    file1 = drive.CreateFile({'title': 'Hello.txt'})\n    file1.SetContentString('Hello')\n    file1.Upload() # Files.insert()\n\n    file1['title'] = 'HelloWorld.txt'  # Change title of the file\n    file1.Upload() # Files.patch()\n\n    content = file1.GetContentString()  # 'Hello'\n    file1.SetContentString(content+' World!')  # 'Hello World!'\n    file1.Upload() # Files.update()\n\n    file2 = drive.CreateFile()\n    file2.SetContentFile('hello.png')\n    file2.Upload()\n    print('Created file %s with mimeType %s' % (file2['title'],\n    file2['mimeType']))\n    # Created file hello.png with mimeType image/png\n\n    file3 = drive.CreateFile({'id': file2['id']})\n    print('Downloading file %s from Google Drive' % file3['title']) # 'hello.png'\n    file3.GetContentFile('world.png')  # Save Drive file as a local file\n\n    # or download Google Docs files in an export format provided.\n    # downloading a docs document as an html file:\n    docsfile.GetContentFile('test.html', mimetype='text/html')\n\nFile listing pagination made easy\n---------------------------------\n\n*PyDrive* handles file listing pagination for you.\n\n.. code:: python\n\n    # Auto-iterate through all files that matches this query\n    file_list = drive.ListFile({'q': \"'root' in parents\"}).GetList()\n    for file1 in file_list:\n        print('title: {}, id: {}'.format(file1['title'], file1['id']))\n\n    # Paginate file lists by specifying number of max results\n    for file_list in drive.ListFile({'maxResults': 10}):\n        print('Received {} files from Files.list()'.format(len(file_list))) # \u003c= 10\n        for file1 in file_list:\n            print('title: {}, id: {}'.format(file1['title'], file1['id']))\n\nConcurrent access made easy\n---------------------------\n\nAll calls made are thread-safe. The underlying implementation in the\ngoogle-api-client library\n`is not thread-safe \u003chttps://developers.google.com/api-client-library/python/guide/thread_safety\u003e`_,\nwhich means that every request has to re-authenticate an http object. You\ncan avoid this overhead by\ncreating your own http object for each thread and re-use it for every call.\n\nThis can be done as follows:\n\n.. code:: python\n\n    # Create httplib.Http() object.\n    http = drive.auth.Get_Http_Object()\n\n    # Create file object to upload.\n    file_obj = drive.CreateFile()\n    file_obj['title'] = \"file name\"\n\n    # Upload the file and pass the http object into the call to Upload.\n    file_obj.Upload(param={\"http\": http})\n\nYou can specify the http-object in every access method which takes a *param*\nparameter.\n\nNote: This is  not an official Google product.\n","funding_links":[],"categories":["Python","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglearchive%2FPyDrive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglearchive%2FPyDrive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglearchive%2FPyDrive/lists"}