{ "info": { "author": "ctf ", "author_email": "tienfu.c@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "## Status\n[![Build Status](https://travis-ci.org/tienfuc/gdcmdtools.svg?branch=master)](https://travis-ci.org/tienfuc/gdcmdtools)\n\n## pypi\n * https://pypi.python.org/pypi/gdcmdtools\n\n## What's new\n * 0.98\n * added gdrm.py, able to remove files and folder. \n\ngdcmdtools\n=========\nGoogle drive command-line tools\n\nTools to maintain files on Google Drive.\n\n# Features\n * Download/Upload files to Google Drive\n * Upload Apps Script project(GAS)\n * Use [Google Drive REST API V2](https://developers.google.com/drive/v2/web/about-sdk)\n\n# Installation\n * Check your system has Python installed\n * gdcmdtools are developed under Python 2.7.3, I would suggest users to run the tools with Python 2.7.3.(OK: 2.7.2)\n * PIP\n * For Mac OSX\n 1. sudo easy_install pip\n 1. sudo pip install google-api-python-client\n 1. sudo pip install gdcmdtools\n * For Ubuntu Linux\n 1. sudo apt-get install python-pip\n 1. sudo pip install google-api-python-client\n 1. sudo pip install gdcmdtools\n * After the installation, you will see gd\\*.py under /usr/local/bin.\n * Ubuntu Linux PPA\n 1. sudo apt-add-repository ppa:ctf/gdcmdtools\n 1. sudo apt-get update\n 1. sudo apt-get install python-gdcmdtools\n\n# API Setup\n * Create a new project for this tool to access your Google drive\n * Visit https://console.developers.google.com/ , create project, name it anything you like, ex: gdcmdtools.\n\n * Enable the following Google APIs in \"APIs & auth/APIs\"\n * Drive API\n * Fusion Tables API\n\n * Make sure your application has an application name in \"APIs & auth/Credentials/OAuthConsent screen\"\n * Find \"PRODUCT NAME\" field. Make sure it's not blank.\n\n * Grant access to Google Drive for gdcmdtools in \"APIs & auth/Credentials\"\n 1. Click \"Create new Client ID\", APPLICATION TYPE: Installed application, INSTALLED APPLICATION TYPE: Other\n 1. Check the section \"Client ID for native application\", click at the \"Download JSON\".\n 1. Execute gdauth.py in a terminal and give the downloaded secret file just downloaded as parameter: $ gdauth.py client_secrets.json\n 1. You will see message like: INFO:gdcmdtools.base:Please visit the URL in your browser: https://accounts.google.com/o/oauth2/auth?scope=....\n 1. Visit the URL with browser and allow the app accessing your Google Drive.\n 1. Copy the code you see in your browser, then back to the terminal, paste the code and hit enter.\n 1. Done, you won't be asked for the code again unless the credential expired.\n\n## gdauth\nUse the tool to pass the OAuth2 authentication\n\n### Usage \n
\nusage: gdauth.py [-h] [-r {local,oob}] secret_file\n\ngdauth v0.0.1 - Google Drive OAuth2 authentication tool - gdcmdtools (Google Drive command line tools)\n\npositional arguments:\n  secret_file           the secret file in JSON format, ~/.gdcmdtools.secrets will be overwritten\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -r {local,oob}, --redirect_uri {local,oob}\n                        specify the redirect URI for the oauth2 flow, could be:\n                        local: means \"http://localhost\"\n                        oob: (default) means \"urn:ietf:wg:oauth:2.0:oob\"\n
\n\n### Examples for gdauth\n % python ./gdauth.py /tmp/client_secrets.json # Use the /tmp/client_secrets.json as secret file\n\n## gdput\nThis tool can be used to upload files to Google drive as Spreadsheet,csv,fusion table,doc, etc.\n\n### Usage\n
\nusage: gdput.py [-h] [-s SOURCE_TYPE] [-l TARGET_TITLE]\n                [-d TARGET_DESCRIPTION] [--no_print_id] [-f FOLDER_ID]\n                [--debug {debug,info,warning,error,critical}]\n                [-p TYPE ROLE VALUE] [-t {raw,ft,pt,ss,doc,ocr,dr,gas}]\n                [--ft_latlng_column FT_LATLNG_COLUMN]\n                [--ft_location_column FT_LOCATION_COLUMN]\n                [--csv_column_define define1_define2_defineN...]\n                source_file\n\ngdput v0.91 - Tool to upload file to Google Drive - gdcmdtools (Google Drive command line tools)\n\npositional arguments:\n  source_file           The file you're going to upload to Google Drive\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s SOURCE_TYPE, --source_type SOURCE_TYPE\n                        define the source file type by MIME type,\n                        ex: \"text/csv\", or \"auto\" to determine the file type by file name\n  -l TARGET_TITLE, --target_title TARGET_TITLE\n                        specify the title of the target file\n  -d TARGET_DESCRIPTION, --target_description TARGET_DESCRIPTION\n                        specify the description of the target file\n  --no_print_id         set if you like not to print the file id after file being uploaded\n  -f FOLDER_ID, --folder_id FOLDER_ID\n                        the target folder ID on the Google drive\n  --debug {debug,info,warning,error,critical}\n                        define the debug level\n  -p TYPE ROLE VALUE, --permission TYPE ROLE VALUE\n                        set the permission of the uploaded file, can be:\n                        type: user, group, domain, anyone\n                        role: owner, reader, writer\n                        value: user or group e-mail address,\n                        or 'me' to refer to the current authorized user\n                        ex: -p anyone reader me # set the uploaded file public-read\n  -t {raw,ft,pt,ss,doc,ocr,dr,gas}, --target_type {raw,ft,pt,ss,doc,ocr,dr,gas}\n                        define the target file type on Google Drive, can be:\n                        raw: (default) the source file will uploaded without touching\n                        ft: Fusion Table (for .csv)\n                        pt: Presentation (for .ppt, .pps, .pptx)\n                        ss: Spreadsheet (for .xls, .xlsx, .ods, .csv, .tsv, .tab)\n                        doc: Document (for .doc, .docx, .html, .htm, .txt, .rtf)\n                        ocr: OCR (for .jpg, .git, .png, .pdf)\n                        dr: Drawing (for .wmf)\n                        gas: GAS project (for .json)\n\nfusion table support (--target_type ft):\n  --ft_latlng_column FT_LATLNG_COLUMN\n                        specify the column header for latitude and longitude for the fusion table,\n                        the column will be created automatically\n  --ft_location_column FT_LOCATION_COLUMN\n                        specify the location column header for the fusion table\n  --csv_column_define define1_define2_defineN...\n                        define the columns type for each column of the csv file,\n                        can be \"string\", \"number\", \"datetime\", or \"location\".\n                        ex: has 4 columns in the csv file: \"name\", \"age\", \"birthday\", \"address\".\n                        you can set --csv_column_define string_number_datetime_location\n\n
\n\n### Examples for gdput\n % python ./gdput.py photo.jpg # upload photo.jpg to gd without changing the format\n % python ./gdput.py -t ft samples/sample.csv # upload a csv file to gd as fusion table\n % python ./gdput.py -t ss samples/sample.csv # upload a csv file to gd as spreadsheet\n % python ./gdput.py -t ft --ft_location_column address --ft_latlng_column latlng samples/sample.csv \n # upload a csv to gd as fusion table with geocoding the latitude longitude data according to the address rows\n % python ./gdput.py -p anyone reader me samples/sample.csv \n # upload a csv file as Spreadsheet and set the file public-read\n % python ./gdput.py -t ft --csv_column_define string_string_location_string_string_number samples/sample.csv\n # upload a csv file as ft with specifed column type\n % python ./gdput.py -t gas gas_project.json\n # update gas project with project file 'gas_project.json'\n\n## gdget\nget files from google drive\n\n### Usage\n
\nusage: gdget.py [-h] [-f FORMAT] [-s NEW_FILE_NAME]\n                [--debug {debug,info,warning,error,critical}]\n                file_id\n\ngdget v0.91 - Tool to download file from Google Drive - gdcmdtools (Google Drive command line tools)\n\npositional arguments:\n  file_id               The id for the file you're going to download\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -f FORMAT, --export_format FORMAT\n                        specify the export format for downloading,\n                        google_format: export_format\n                        spreadsheet: pdf, ods, xlsx\n                        drawing: png, pdf, jpeg, svg\n                        document: pdf, docx, rtf, odt, html, txt\n                        script+json: json\n                        presentation: pdf, pptx, txt\n  -s NEW_FILE_NAME, --save_as NEW_FILE_NAME\n                        save the downloaded file as \n  --debug {debug,info,warning,error,critical}\n                        define the debug level\n\n
\n\n### Examples for gdget\n % python ./gdget.py FILE_ID --export_format pdf -s /tmp/myfile.pdf # export the file as pdf and save as /tmp/myfile.pdf\n % python ./gdget.py FILE_ID -f json # down files associated with GAS project\n\n\n## gdperm\nThis tool can be used to set up file's permission\n\n### Usage\n
\nusage: gdperm.py [-h]\n                 [--list | --get PERMISSION_ID | --insert TYPE ROLE VALUE | --delete PERMISSION_ID]\n                 file_id\n\ngdperm v0.0.1 - Tool to change file's permission on Google Drive - gdcmdtools (Google Drive command line tools)\n\npositional arguments:\n  file_id               The id of file you're going to change permission\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --list                list the permission resource of the file\n  --get PERMISSION_ID   get the permission resource by id\n  --insert TYPE ROLE VALUE\n                        insert the permission to the file by id\n  --delete PERMISSION_ID\n                        delete the permission of the file by id\n
\n\n### Examples for gdperm\n % python ./gdperm.py 0B_XXXXXXXXXX --insert anyone reader me # set the file as public-read\n % python ./gdperm.py 0B_XXXXXXXXXX --list # list the permissions by file id: 0B_XXXXXXXXXX\n % python ./gdperm.py 0B_XXXXXXXXXX --get 5566520 # get the permissions by permission id: 5566520\n % python ./gdperm.py 0B_XXXXXXXXXX --delete 5566520 # delete the permissions by permission id: 5566520\n\n\n\n## Packages\n * ubuntu PPA: https://launchpad.net/~ctf/+archive/gdcmdtools\n\n\n\n## License\nBSD 2-Clause License\n\n## Bug\nPlease report bugs via https://github.com/tienfuc/gdcmdtools/issues\n\n## Author\nTien Fu Chen\n\nEmail: tienfu.c @ gmail.com\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tienfuc/gdcmdtools", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "gdcmdtools3", "package_url": "https://pypi.org/project/gdcmdtools3/", "platform": "", "project_url": "https://pypi.org/project/gdcmdtools3/", "project_urls": { "Homepage": "https://github.com/tienfuc/gdcmdtools" }, "release_url": "https://pypi.org/project/gdcmdtools3/1.7.1/", "requires_dist": [ "requests (>=1.2.3)", "google-api-python-client (>=1.1)", "requests-oauthlib (>=0.4.2)" ], "requires_python": "", "summary": "Google drive command-line tools", "version": "1.7.1" }, "last_serial": 5497372, "releases": { "1.7.1": [ { "comment_text": "", "digests": { "md5": "8f69f10a353c21c694356d176713bb31", "sha256": "ce2be63d7108c600825ab8e6247b6938e02376d4697e61c8e39b232f915cb226" }, "downloads": -1, "filename": "gdcmdtools3-1.7.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8f69f10a353c21c694356d176713bb31", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31120, "upload_time": "2019-07-07T15:11:27", "url": "https://files.pythonhosted.org/packages/a4/57/1a75b5a378629d9ec8ed57d4c38304a91c946d210e7b8e2b8ef57fdc4573/gdcmdtools3-1.7.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2313ddd72e0d0f47f0be8cd6612582f", "sha256": "d7bf6126b92656b4b67b8d6bcb905cb6ef996c62bff98b76693c2d67e2ad511d" }, "downloads": -1, "filename": "gdcmdtools3-1.7.1.tar.gz", "has_sig": false, "md5_digest": "c2313ddd72e0d0f47f0be8cd6612582f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20990, "upload_time": "2019-07-07T15:11:29", "url": "https://files.pythonhosted.org/packages/19/be/1e98c67bb94388ec3f685769508f3a8b8fb453c87fbdc6ad50b5edfceae4/gdcmdtools3-1.7.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8f69f10a353c21c694356d176713bb31", "sha256": "ce2be63d7108c600825ab8e6247b6938e02376d4697e61c8e39b232f915cb226" }, "downloads": -1, "filename": "gdcmdtools3-1.7.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8f69f10a353c21c694356d176713bb31", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31120, "upload_time": "2019-07-07T15:11:27", "url": "https://files.pythonhosted.org/packages/a4/57/1a75b5a378629d9ec8ed57d4c38304a91c946d210e7b8e2b8ef57fdc4573/gdcmdtools3-1.7.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2313ddd72e0d0f47f0be8cd6612582f", "sha256": "d7bf6126b92656b4b67b8d6bcb905cb6ef996c62bff98b76693c2d67e2ad511d" }, "downloads": -1, "filename": "gdcmdtools3-1.7.1.tar.gz", "has_sig": false, "md5_digest": "c2313ddd72e0d0f47f0be8cd6612582f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20990, "upload_time": "2019-07-07T15:11:29", "url": "https://files.pythonhosted.org/packages/19/be/1e98c67bb94388ec3f685769508f3a8b8fb453c87fbdc6ad50b5edfceae4/gdcmdtools3-1.7.1.tar.gz" } ] }