gdoc-down documentation

API and command line program to save Google documents, presentations, and worksheets in a local Google Drive / Backup & Sync directory to to local files.

gdoc-down supports several formats:

  • CSV (.csv)
  • EPUB (.epub)
  • Excel workbook (.xlsx)
  • HTML (.html)
  • Image (.png, .jpg, .svg)
  • LaTeX (.tex)
  • Open Office document (.odt)
  • Open Office presentation (.odp)
  • Open Office workbook (.ods)
  • Plain text file (.txt)
  • Portable document format (.pdf)
  • Powerpoint presentation (.pptx)
  • Rich text document (.rtf)
  • TSV (.tsv)
  • Word document (.docx)

gdoc-down also has special features for handling .gdoc files that contain LaTeX:

  • gdoc-down ignores all images. This allows the user to place images inside the Google document for convenience and to use includegraphics to embed images in compile PDF files.
  • gdoc-down will convert all Google document comments to PDF comments.
  • gdoc-down ignores all page breaks.

The first time gdoc-down is called, gdoc-down will request access to the user’s Google account. This will create a client.json file in the users home directory (~/.gdoc_down/client.json).

Contents

Installation

Prerequisites

  • Python
  • Pip

Latest release From PyPI

Run the following command to install the latest release from PyPI:

pip install gdoc_down

Latest revision from GitHub

Run the following command to install the latest version from GitHub:

pip install git+https://github.com/KarrLab/gdoc_down.git#gdoc_down

Command line usage

gdoc-down (sub-commands ...) [options ...] {arguments ...}

Download Google documents to local files in various formats

positional arguments:
  gdoc_file             path to Google document

optional arguments:
  -h, --help            show this help message and exit
  --debug               toggle debug output
  --quiet               suppress all output
  --format FORMAT, -f FORMAT
                        output format (docx, html, odft, pdf, rtf, tex, txt)
  --out_path OUT_PATH, -o OUT_PATH
                        path where Google document should be downloaded
  --extension EXTENSION, -e EXTENSION
                        output extension

Examples:

gdoc-down -f docx /path/to/Google \Drive/file.gdoc
gdoc-down -f pptx /path/to/Google \Drive/file.gslides
gdoc-down -f xlsx /path/to/Google \Drive/file.gsheet

About

License

The software is released under the MIT license

The MIT License (MIT)

Copyright (c) 2016 Karr Lab

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Development team

This package was developed by the Karr Lab at the Icahn School of Medicine at Mount Sinai in New York, USA.

Acknowledgements

This work was supported by a National Institute of Health MIRA award [grant number 1 R35 GM 119771-01].

Questions and comments

Please contact the Karr Lab with any questions or comments.