{"id":13815054,"url":"https://github.com/fsspec/gdrivefs","last_synced_at":"2025-05-15T06:34:06.995Z","repository":{"id":42584471,"uuid":"216214277","full_name":"fsspec/gdrivefs","owner":"fsspec","description":"Google drive implementation of fsspec","archived":false,"fork":false,"pushed_at":"2025-01-29T16:44:17.000Z","size":79,"stargazers_count":44,"open_issues_count":12,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-15T00:10:20.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fsspec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2019-10-19T13:54:25.000Z","updated_at":"2025-05-09T07:10:49.000Z","dependencies_parsed_at":"2024-04-24T07:29:23.017Z","dependency_job_id":null,"html_url":"https://github.com/fsspec/gdrivefs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fgdrivefs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fgdrivefs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fgdrivefs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspec%2Fgdrivefs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsspec","download_url":"https://codeload.github.com/fsspec/gdrivefs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254289117,"owners_count":22046033,"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":[],"created_at":"2024-08-04T04:02:53.407Z","updated_at":"2025-05-15T06:34:06.989Z","avatar_url":"https://github.com/fsspec.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Google Drive fsspec implementation\n\nThis is an implementation of the fsspec interface for Google Drive.\n\nThis software is in alpha stage and should not be relied upon in production settings.\n\n## Installation\n\nYou can install it directly from source using pip:\n\n```sh\npip install git+https://github.com/fsspec/gdrivefs\n```\n\n\u003e [!IMPORTANT]\n\u003e gdrivefs is *not* released on PyPI. Note that there is a project on PyPI with the name `gdrivefs` which is unrelated and does not implement fsspec. See #21.\n\n## Usage\n\nAs gdrivefs implements the fsspec interface, most documentation can be found at https://filesystem-spec.readthedocs.io/en/latest/usage.html.\n\n### Authentication\n\nThere are several methods to authenticate gdrivefs against Google Drive.\n\n1. Service account credentials\n\n    In this method, you providea dict containing the service account credentials obtainend in GCP console. The dict content is the same as the json file downloaded from GCP console. More details can be found here: \u003chttps://cloud.google.com/iam/docs/service-account-creds#key-types\u003e. This credential can be useful when integrating with other GCP services, and when you don't want the user to be prompted to authenticate.\n\n    ```python\n    fs = GoogleDriveFileSystem(creds=service_account_credentials)\n    ```\n\n2. OAuth with user credentials\n\n    A browser will be opened to complete the OAuth authentication flow. Afterwards, the access token will be stored locally and you can re-use it in subsequent sessions.\n\n    ```python\n    # use this the first time you run\n    token = 'browser'\n    # use this on subsequent attempts\n    #token = 'cache'\n    fs = gdrivefs.GoogleDriveFileSystem(token=token)\n    ```\n\n3. Anonymous (read-only) access\n\n    If you want to interact with files that are shared publicly (\"anyone with the link\"), then you do not need to authenticate to Google Drive.\n\n    ```python\n    token = 'anon'\n    fs = gdrivefs.GoogleDriveFileSystem(token=token)\n    ```\n\nSee [GoogleDriveFileSystem](https://github.com/fsspec/gdrivefs/blob/master/gdrivefs/core.py#L41) docstring for more details.\n\n## Development\n\n### Running tests\n\n#### Unit tests\n\n```sh\npip install -e . pytest\npytest -v\n```\n\n#### Integration tests\n\nTo run integration tests, you need to have user credentials cached locally that can be used to interact with your real Google Drive account. You can do this by running the following command:\n\n```py\nimport gdrivefs\nfs = gdrivefs.GoogleDriveFileSystem(token='browser')\nprint(fs._user_credentials_cache_dir)\n```\n\nAlternatively, you can save user credentials in a file and set the environment variable `GDRIVEFS_USER_CREDENTIALS_PATH` to the path of the file.\n\nThen you can run the integration tests:\n\n```sh\npytest -v -m integration\n```\n\n## Other implementations\n\n- [PyDrive2](https://github.com/iterative/PyDrive2?tab=readme-ov-file#fsspec-filesystem) also provides an fsspec-compatible Google Drive API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsspec%2Fgdrivefs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsspec%2Fgdrivefs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsspec%2Fgdrivefs/lists"}