Package: google-drive
google drive pythonLibrary and cli to manage and interact with your Google Drive, sheets and docshttps://pypi.org/project/google-drive/Table of ContentsIntroductionObtaining credentials for Google APIsInstalling google-drive CLICLI DocumentationContributingLicenseIntroductionObtaining credentials for Google APIsGoogle API credentialsCreate a Google project :zap:Just access toGoogle APIs.Orclick herefor a quick project creation.Create credentials for your project :key:Once you have created your project, you can create your project's credentials.To manage project's credentials you have the sectionapi/credentialswithinGoogle APIs. But if this is your first credentials creation you better follow these steps:First, you have to create theconsentfor your projectOnce the consent is already created and you have a name for you google app you can create your credentials:Go to+ Create Credentialsand selectOAuth ID clientOr access toapi/credentials/oauthclientThe OAuth client type isotherand choose the name you prefer :smiley:You have already created your credentials! :fireworks:Just place them in acredentials.jsonfile in the root of this repository. :heavy_exclamation_mark::heavy_exclamation_mark:Enable Google APIs :books:You can see where you have to access for each google api in the docgoogle apis usageGenerating your token.pickle :unlock:To authenticate us we have to send a token.pickle to Google APIs, this token.pickle is generated using the file credentials.json.To generate this we have the make target google-auth, so, you just have to tunmake google-auth:warning: Credentials files to authenticate yourself are included in our.gitignore:angel: So, you don't have to worry about that :smiley:Installing google-drive CLIUsing makemake installUsing pippip install google-driveWith specific versionLook for available versions with:pip install google-drive==And select one and run:pip install google-drive==<VERSION>CLI Documentationgoogle-drive --helpShows the help messageUsage> google-drive --help
Usage: google-drive [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  get    Get file metadata
  get-mimetypes  Get Mimetypes availables in this API implementation
  login  Perform a login with google oauth
  ls     List directory contents
  mkdir  Make directorygoogle-drive get-mimetypesGet Mimetypes availables in this API implementationUsage>  google-drive get-mimetypes credentials.json
  - application/vnd.google-apps.folder
  - application/vnd.google-apps.document
  - application/vnd.google-apps.spreadsheet
  - application/pdfgoogle-drive loginPerform a login with google oauth.Usage> google-drive login <path-to-credentials-file.json>google-drive lsList directory contentsUsage> google-drive ls <directory>/<maybe-some-subdir> <path-to-credentials-file.json>
- (<GOOGLE_DOC_ID_1>, <FILENAME_1>, <FILE_MIMETYPE_1>)
- (<GOOGLE_DOC_ID_2>, <FILENAME_2>, <FILE_MIMETYPE_2>)
- (<GOOGLE_DOC_ID_3>, <FILENAME_3>, <FILE_MIMETYPE_3>)
...
- (<GOOGLE_DOC_ID_N>, <FILENAME_N>, <FILE_MIMETYPE_N>)google-drive getGet file metadataUsage> google-drive get <GOOGLE_DOC_ID> <path-to-credentials-file.json>

File Metadata:
==
id: <GOOGLE_DOC_ID>
name: <FILENAME>
parents: ['<GOOGLE_DOC__PARENT_ID>']
mime_type: <FILE_MIMETYPE>
export_links:
  - application/rtf: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=rtf
  - application/vnd.oasis.opendocument.text: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=odt
  - text/html: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=html
  - application/pdf: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=pdf
  - application/epub+zip: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=epub
  - application/zip: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=zip
  - application/vnd.openxmlformats-officedocument.wordprocessingml.document: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=docx
  - text/plain: https://docs.google.com/feeds/download/documents/export/Export?id=<GOOGLE_DOC_ID>&exportFormat=txtgoogle-drive mkdirMake directoryUsage> google-drive mkdir <DIR_NAME> <path-to-credentials-file.json>
(<GOOGLE_DOC_ID>, <DIR_NAME>, application/vnd.google-apps.folder)google-drive touchCreate empty file of specified mimetypeUsage> google-drive touch <EXISTING_DIR>/<FILENAME> <SOME_MYMETYPE> <path-to-credentials-file.json>
(<GOOGLE_DOC_ID>, <FILENAME>, <SOME_MYMETYPE>)It could raiseMissingGoogleDriveFolderExceptionwhen parent directories do not exist.Using googledrive as API SDKContributingContributions are welcome! Please see ourContributing GuideandStyle Guidefor more
details.You can visit ourTODOlist :)LicenseThis project is licensed under theApache license.