{"id":22281559,"url":"https://github.com/iterative/pydrive2","last_synced_at":"2025-05-14T02:08:02.117Z","repository":{"id":37917805,"uuid":"233801675","full_name":"iterative/PyDrive2","owner":"iterative","description":"Google Drive API Python wrapper library. Maintained fork of PyDrive.","archived":false,"fork":false,"pushed_at":"2025-03-10T02:00:52.000Z","size":9207,"stargazers_count":629,"open_issues_count":48,"forks_count":72,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-08T07:40:37.501Z","etag":null,"topics":["api","documentation","dvc","gdrive","google","pages","pydrive","python"],"latest_commit_sha":null,"homepage":"https://docs.iterative.ai/PyDrive2","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/iterative.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-14T09:13:38.000Z","updated_at":"2025-05-06T12:24:26.000Z","dependencies_parsed_at":"2023-12-25T06:28:13.160Z","dependency_job_id":"fdefcd0d-86f3-4de5-9b9b-deece1f177ea","html_url":"https://github.com/iterative/PyDrive2","commit_stats":{"total_commits":335,"total_committers":40,"mean_commits":8.375,"dds":0.7492537313432837,"last_synced_commit":"77e4b659593644dca5018f65c04c6f26b35ba4f1"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2FPyDrive2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2FPyDrive2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2FPyDrive2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2FPyDrive2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iterative","download_url":"https://codeload.github.com/iterative/PyDrive2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052941,"owners_count":22006717,"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":["api","documentation","dvc","gdrive","google","pages","pydrive","python"],"created_at":"2024-12-03T16:19:19.807Z","updated_at":"2025-05-14T02:07:57.099Z","avatar_url":"https://github.com/iterative.png","language":"Python","readme":"|CI| |Conda| |PyPI|\n\n.. |CI| image:: https://github.com/iterative/PyDrive2/workflows/Tests/badge.svg?branch=main\n   :target: https://github.com/iterative/PyDrive2/actions\n   :alt: GHA Tests\n\n.. |Conda| image:: https://img.shields.io/conda/v/conda-forge/PyDrive2.svg?label=conda\u0026logo=conda-forge\n   :target: https://anaconda.org/conda-forge/PyDrive2\n   :alt: Conda-forge\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/PyDrive2.svg?label=pip\u0026logo=PyPI\u0026logoColor=white\n   :target: https://pypi.org/project/PyDrive2\n   :alt: PyPI\n\nPyDrive2\n--------\n\n*PyDrive2* 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 V2 tasks. It is an actively\nmaintained fork of `https://pypi.python.org/pypi/PyDrive \u003chttps://pypi.python.org/pypi/PyDrive\u003e`_.\nBy the authors and maintainers of the `Git for Data \u003chttps://dvc.org\u003e`_ - DVC\nproject.\n\nProject Info\n------------\n\n- Package: `https://pypi.python.org/pypi/PyDrive2 \u003chttps://pypi.python.org/pypi/PyDrive2\u003e`_\n- Documentation: `https://docs.iterative.ai/PyDrive2 \u003chttps://docs.iterative.ai/PyDrive2\u003e`_\n- Source: `https://github.com/iterative/PyDrive2 \u003chttps://github.com/iterative/PyDrive2\u003e`_\n- Changelog: `https://github.com/iterative/PyDrive2/releases \u003chttps://github.com/iterative/PyDrive2/releases\u003e`_\n- `Running tests \u003c/pydrive2/test/README.rst\u003e`_\n\nFeatures of PyDrive2\n--------------------\n\n-  Simplifies OAuth2.0 into just few lines with flexible settings.\n-  Wraps `Google Drive API V2 \u003chttps://developers.google.com/drive/v2/web/about-sdk\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-  Provides `fsspec`_ filesystem implementation.\n\nHow to install\n--------------\n\nYou can install PyDrive2 with regular ``pip`` command.\n\n::\n\n    $ pip install PyDrive2\n\nTo install the current development version from GitHub, use:\n\n::\n\n    $  pip install git+https://github.com/iterative/PyDrive2.git#egg=PyDrive2\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 pydrive2.auth import GoogleAuth\n    from pydrive2.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. PyDrive2 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*PyDrive2* 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\nFsspec filesystem\n-----------------\n\n*PyDrive2* provides easy way to work with your files through `fsspec`_\ncompatible `GDriveFileSystem`_.\n\nInstall PyDrive2 with the required dependencies\n\n::\n\n    $ pip install PyDrive2[fsspec]\n\n.. code:: python\n\n    from pydrive2.fs import GDriveFileSystem\n\n    # replace `root` with ID of a drive or directory and give service account access to it\n    fs = GDriveFileSystem(\"root\", client_id=my_id, client_secret=my_secret)\n\n    for root, dnames, fnames in fs.walk(\"root\"):\n        ...\n\n.. _`GDriveFileSystem`: https://docs.iterative.ai/PyDrive2/fsspec/\n\nConcurrent access made easy\n---------------------------\n\nAll API functions made to be thread-safe.\n\nContributors\n------------\n\nThanks to all our contributors!\n\n.. image:: https://contrib.rocks/image?repo=iterative/PyDrive2\n   :target: https://github.com/iterative/PyDrive2/graphs/contributors\n\n.. _`fsspec`: https://filesystem-spec.readthedocs.io/en/latest/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterative%2Fpydrive2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiterative%2Fpydrive2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterative%2Fpydrive2/lists"}