Skip to content

docstring_gen¤

This command reads a Jupyter notebook or Python file, or a directory containing these files, and adds docstrings to classes and methods that do not have them.

Usage:

$ docstring_gen [OPTIONS] [PATH]

Arguments:

  • [PATH]: The path to the Jupyter notebook or Python file, or a directory containing these files [default: .]

Options:

  • --include-auto-gen-txt / --no-include-auto-gen-txt: If set to True, a note indicating that the docstring was autogenerated by docstring-gen library will be added to the end. [default: include-auto-gen-txt]
  • -f, --force-recreate-auto-generated: If set to True, the autogenerated docstrings from the previous runs will be replaced with the new one.
  • --model TEXT: The name of the GPT model that will be used to generate docstrings. [default: gpt-3.5-turbo]
  • --temperature FLOAT RANGE: Setting the temperature close to zero produces better results, whereas higher temperatures produce more complex, and sometimes irrelevant docstrings. [default: 0.2; 0.0<=x<=2.0]
  • --max-tokens INTEGER: The maximum number of tokens to be used when generating a docstring for a function or class. Please note that a higher number will deplete your token quota faster. [default: 250]
  • --top-p FLOAT RANGE: You can also specify a top-P value from 0-1 to achieve similar results to changing the temperature. According to the Open AI documentation, it is generally recommended to change either this or the temperature but not both. [default: 1.0; 0.0<=x<=1.0]
  • --n INTEGER: The number of docstrings to be generated for each function or class, with the best one being added to the source code. Please note that a higher number will deplete your token quota faster. [default: 3]
  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.