gummy.cli module

CLI(Command Line Interface) tools

Since the following two programs are frequently used, I created this file to be called from command line.

  • Translate your journals and generate a PDF.

  • Translation

gummy.cli.translate_journal(argv=['-M', 'html', '.', '_build'])[source]

Translate journals.

Parameters
  • url (str) – URL of a paper or path/to/local.pdf. (required)

  • -G/--gateway (str) – Gateway identifier, string name of a gateway. (default= "useless" )

  • -T/--translator (str) – Translator identifier, string name of a translator. (default= "deepl" )

  • -J/--journal (str) – Journal identifier, string name of a journal. (default= None )

  • --crawl-type (str) – Crawling type, if you not specify, use recommended crawling type. (default= None )

  • -O/--out-dir (str) – Where you want to save a created PDF. (default= GUMMY_DIR )

  • --browser (bool) – Whether you want to run Chrome with GUI browser. (default= False )

  • -pdf/--pdf-path (str) – Path to output pdf file path. (default= None )

  • -tpl/--tpl-path (str) – Path to template path. (default= None )

  • --save-html (bool) – Whether you want to save an intermediate html file. (default= False )

  • --quiet (bool) – Whether you want to be quiet or not. (default= False )

  • --translator-verbose (bool) – Whether you want to print translator’s output or not. (default= False )

  • -GP/--gateway-params (dict) – Specify the value required to pass through the gateway. You can specify by -GP username=USERNAME -GP password=PASSWORD (default= {} )

Note

When you run from the command line, execute as follows:

$ gummy-journal "https://www.nature.com/articles/ncb0800_500"

Examples

>>> $ gummy-journal "https://www.nature.com/articles/ncb0800_500"
gummy.cli.translate_text(argv=['-M', 'html', '.', '_build'])[source]

Translate from Japanese to English.

Parameters
  • query (str) – English to be translated. (required)

  • -T/--translator (str) – Translator identifier, string name of a translator. (default= "deepl" )

  • --browser (bool) – Whether you want to run Chrome with GUI browser. (default= False )

  • --quiet (bool) – Whether you want to be quiet or not. (default= False )

  • --translator-verbose (bool) – Whether you want to print translator’s output or not. (default= False )

Note

When you run from the command line, execute as follows:

$ gummy-translate "This is a pen."

Examples

>>> $ gummy-translate "This is a pen."