{"id":20327465,"url":"https://github.com/eduardogr/google-drive-python","last_synced_at":"2025-07-14T22:33:16.393Z","repository":{"id":55830691,"uuid":"312716701","full_name":"eduardogr/google-drive-python","owner":"eduardogr","description":"Library and cli to manage and interact with your Google Drive. https://pypi.org/project/google-drive/","archived":false,"fork":false,"pushed_at":"2025-04-16T11:43:26.000Z","size":120,"stargazers_count":20,"open_issues_count":18,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-22T00:42:26.747Z","etag":null,"topics":["google-api","google-drive","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eduardogr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2020-11-14T00:45:11.000Z","updated_at":"2025-06-14T16:53:11.000Z","dependencies_parsed_at":"2025-04-11T20:08:47.182Z","dependency_job_id":null,"html_url":"https://github.com/eduardogr/google-drive-python","commit_stats":{"total_commits":37,"total_committers":3,"mean_commits":"12.333333333333334","dds":0.08108108108108103,"last_synced_commit":"d1295c0660d837b931e94cc37ddc7027b6f078ca"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/eduardogr/google-drive-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardogr%2Fgoogle-drive-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardogr%2Fgoogle-drive-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardogr%2Fgoogle-drive-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardogr%2Fgoogle-drive-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eduardogr","download_url":"https://codeload.github.com/eduardogr/google-drive-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardogr%2Fgoogle-drive-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265360481,"owners_count":23752719,"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-api","google-drive","python"],"created_at":"2024-11-14T19:47:42.737Z","updated_at":"2025-07-14T22:33:16.381Z","avatar_url":"https://github.com/eduardogr.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003e google drive python \u003c/h1\u003e \u003cbr\u003e\n\nLibrary and cli to manage and interact with your Google Drive, sheets and docs\n\n- https://pypi.org/project/google-drive/ \n\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n1. [Obtaining credentials for Google APIs](#obtaining-credentials-for-google-apis)\n1. [Installing google-drive CLI](#installing-google-drive-cli)\n1. [CLI documentation](#cli-documentation)\n1. [Library documentation](#library-documentation)\n1. [Contributing](#contributing)\n1. [License](#license)\n\n# Introduction \n![Build Status](https://github.com/eduardogr/google-drive-python/actions/workflows/python-tests.yml/badge.svg?event=push)\n[![Python](https://img.shields.io/badge/Python-v3.9%2B-blue)]()\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n[![GitHub license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/eduardogr/google-drive-python/blob/main/LICENSE)  \n\n## Obtaining credentials for Google APIs\n\n### Google API credentials\n\n#### Create a Google project :zap:\n\nJust access to [Google APIs](https://console.developers.google.com/).\n\n  - Or [click here](https://console.developers.google.com/projectcreate) for a quick project creation.\n\n#### Create credentials for your project :key:\n\nOnce you have created your project, you can create your project's credentials.\n\nTo manage project's credentials you have the section [api/credentials](https://console.developers.google.com/apis/credentials) within [Google APIs](https://console.developers.google.com/). But if this is your first credentials creation you better follow these steps:\n\n  - First, you have to create the [consent](https://console.developers.google.com/apis/credentials/consent) for your project\n  - Once the consent is already created and you have a name for you google app you can create your credentials:\n      - Go to *+ Create Credentials* and select *OAuth ID client*\n      - Or access to [api/credentials/oauthclient](https://console.developers.google.com/apis/credentials/oauthclient)\n      - The OAuth client type is *other* and choose the name you prefer :smiley:\n\nYou have already created your credentials! :fireworks:\n\nJust place them in a `credentials.json` file in the root of this repository. :heavy_exclamation_mark::heavy_exclamation_mark:\n\n#### Enable Google APIs :books:\n\nYou can see where you have to access for each google api in the doc [google apis usage](./google-apis-usage.md)\n\n#### Generating your token.pickle :unlock:\n\nTo authenticate us we have to send a token.pickle to Google APIs, this token.pickle is generated using the file credentials.json.\n\nTo generate this we have the make target google-auth, so, you just have to tun\n\n  - `make google-auth`\n\n\n:warning: Credentials files to authenticate yourself are included in our [.gitignore](.gitignore)\n\n:angel: So, you don't have to worry about that :smiley:\n\n\n# Installing google-drive CLI\n\n## Using pipx\n\n```\npipx install git+https://github.com/eduardogr/google-drive-python.git\n```\n\n## Using pip\n\n```\npip install google-drive\n```\n\n### With specific version\n\nLook for available versions with:\n\n```\npip install google-drive==\n```\n\nAnd select one and run:\n\n```\npip install google-drive==\u003cVERSION\u003e\n```\n\n# CLI documentation\n\n## google-drive --help\n\nShows the help message\n\n### Usage\n\n```\n\u003e google-drive --help\nUsage: google-drive [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  get    Get file metadata\n  get-mimetypes  Get Mimetypes availables in this API implementation\n  login  Perform a login with google oauth\n  ls     List directory contents\n  mkdir  Make directory\n```\n\n## google-drive get-mimetypes\n\nGet Mimetypes availables in this API implementation\n\n### Usage\n\n```\n\u003e  google-drive get-mimetypes credentials.json\n  - application/vnd.google-apps.folder\n  - application/vnd.google-apps.document\n  - application/vnd.google-apps.spreadsheet\n  - application/pdf\n```\n\n## google-drive login\n\nPerform a login with google oauth.\n\n### Usage\n\n```\n\u003e google-drive login \u003cpath-to-credentials-file.json\u003e\n```\n\n## google-drive ls\n\nList directory contents\n\n### Usage\n\n```\n\u003e google-drive ls \u003cdirectory\u003e/\u003cmaybe-some-subdir\u003e \u003cpath-to-credentials-file.json\u003e\n- (\u003cGOOGLE_DOC_ID_1\u003e, \u003cFILENAME_1\u003e, \u003cFILE_MIMETYPE_1\u003e)\n- (\u003cGOOGLE_DOC_ID_2\u003e, \u003cFILENAME_2\u003e, \u003cFILE_MIMETYPE_2\u003e)\n- (\u003cGOOGLE_DOC_ID_3\u003e, \u003cFILENAME_3\u003e, \u003cFILE_MIMETYPE_3\u003e)\n...\n- (\u003cGOOGLE_DOC_ID_N\u003e, \u003cFILENAME_N\u003e, \u003cFILE_MIMETYPE_N\u003e)\n```\n\n## google-drive get\n\nGet file metadata\n\n### Usage\n\n```\n\u003e google-drive get \u003cGOOGLE_DOC_ID\u003e \u003cpath-to-credentials-file.json\u003e\n\nFile Metadata:\n==\nid: \u003cGOOGLE_DOC_ID\u003e\nname: \u003cFILENAME\u003e\nparents: ['\u003cGOOGLE_DOC__PARENT_ID\u003e']\nmime_type: \u003cFILE_MIMETYPE\u003e\nexport_links:\n  - application/rtf: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=rtf\n  - application/vnd.oasis.opendocument.text: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=odt\n  - text/html: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=html\n  - application/pdf: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=pdf\n  - application/epub+zip: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=epub\n  - application/zip: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=zip\n  - application/vnd.openxmlformats-officedocument.wordprocessingml.document: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=docx\n  - text/plain: https://docs.google.com/feeds/download/documents/export/Export?id=\u003cGOOGLE_DOC_ID\u003e\u0026exportFormat=txt\n  ```\n\n## google-drive mkdir\n\nMake directory\n\n### Usage\n\n```\n\u003e google-drive mkdir \u003cDIR_NAME\u003e \u003cpath-to-credentials-file.json\u003e\n(\u003cGOOGLE_DOC_ID\u003e, \u003cDIR_NAME\u003e, application/vnd.google-apps.folder)\n```\n\n## google-drive touch\n\nCreate empty file of specified mimetype\n\n### Usage\n\n```\n\u003e google-drive touch \u003cEXISTING_DIR\u003e/\u003cFILENAME\u003e \u003cSOME_MYMETYPE\u003e \u003cpath-to-credentials-file.json\u003e\n(\u003cGOOGLE_DOC_ID\u003e, \u003cFILENAME\u003e, \u003cSOME_MYMETYPE\u003e)\n```\n\nIt could raise `MissingGoogleDriveFolderException` when parent directories do not exist.\n\n# Library documentation\n\nUsing `googledrive` as a library.\n\n\u003e TBC\n\n# Contributing\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\nContributions are welcome! Please see our [Contributing Guide](\u003cCONTRIBUTING.md\u003e) and [Style Guide](\u003cSTYLE.md\u003e) for more\ndetails. \n\nYou can visit our [TODO](TODO.md) list :)\n\n# License\n\nThis project is licensed under the [Apache license](https://github.com/eduardogr/google-drive-python/blob/main/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduardogr%2Fgoogle-drive-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feduardogr%2Fgoogle-drive-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduardogr%2Fgoogle-drive-python/lists"}