Welcome to docCLI’s documentation!

Indices and tables

Docs

docCLI.docs.open_docs(*args, **kwargs)

Entry point for the docs command

This function is called whenever the docs command is used.

Parameters:
  • filename (str) – The filename (not including a file extension) as it appears in Google drive.
  • upload (str) – The name of the local file (including extension) to be uploaded.
  • no_open (bool) – Flag to suppress opening browser window after uploading a file.
  • download (bool) – Flag to download the file to the current working directory instead of opening it
  • edit (bool) – Flag to download the file and open the local copy for editing with a command line text editor. Downloads the document in .txt format unless specified.
  • editor (str) – The editor to open the downloaded file with.
  • ext (str) – The file extension to export the document from Google drive as.

Drive

docCLI.drive.open_drive(*args, **kwargs)

Entry point for the drive command

This function is called whenever the drive command is used. This is intended to be used with files that are not docs/sheets (e.g. .mp3, .iso etc).

Parameters:
  • filename (str) – The filename (including a file extension) as it appears in Google drive.
  • upload (str) – The name of the local file (including extension) to be uploaded.
  • no_open (bool) – Flag to suppress opening browser window after uploading a file.
  • download (bool) – Flag to download the file to the current working directory instead of opening it

Sheets

docCLI.sheets.open_sheets(*args, **kwargs)

Entry point for the sheets command

This function is called whenever the sheets command is used. This is intended to be used with spreadsheets.

Parameters:
  • filename (str) – The filename (not including a file extension) as it appears in Google drive.
  • no_open (bool) – Flag to suppress opening browser window after uploading a file.
  • download (bool) – Flag to download the file to the current working directory instead of opening it
  • ext (str) – The file extension to export the document from Google drive as.

Core

docCLI.core.upload_file(filename)

Uploads a file to Google drive and returns the file id

docCLI.core.download_file(filename, file_id, ext, callback=None)

Downloads a document/sheet from google docs

docCLI.core.get_file_id(filename)

Searches google drive for a file and returns the file id.

docCLI.core.create_handler(editor=None)

Creates the callback function to open the editor. Defaults to vim if no editor is passed and there is not an env var set under EDITOR

docCLI.core.create_url_creator(service)

Creates the function that will create a url depending on the service