Command Line Interface (CLI)

The first option when using gpt4docstrings is to use it as a Command Line Interface (CLI). The options available for the CLI can be seen below.

gpt4docstrings

gpt4docstrings [OPTIONS] [PATHS]...

Options

-h, --help

Show this message and exit.

-S, --ignore-setters

Ignore methods with property setter decorators.

Default:

False

-P, --ignore-property-decorators

Ignore methods with property setter/getter decorators.

Default:

False

-n, --ignore-nested-functions

Ignore nested functions and methods.

Default:

False

-C, --ignore-nested-classes

Ignore nested classes.

Default:

False

-i, --ignore-init-method

Ignore __init__ method of classes.

Default:

False

-s, --ignore-semiprivate

Ignore semiprivate classes, methods, and functions starting with a single underscore.

Default:

False

-p, --ignore-private

Ignore private classes, methods, and functions starting with two underscores. [default: False]

-w, --overwrite

If True, it will directly write the docstrings into the files (it will not generate git patches)

Default:

False

-v, --verbose <verbose>

Verbosity parameter. Defaults to 0.

-e, --exclude <exclude>

Exclude PATHs of files and/or directories. Multiple -e/–exclude invocations supported.

-k, --api_key <api_key>

OpenAI’s API key. If not provided, gpt4docstrings will try to access OPENAI_API_KEY environment variable.

-st, --style <style>

Docstring style, which must be one of ‘google’, ‘reStructuredText’, ‘epytext’, ‘numpy’

-t, --translate

If True, instead of creating new docstrings, it will translate the existing ones into the provided style

Default:

True

-m, --model <model>

The model to be used by gpt4docstrings. By default, gpt-3.5-turbo.

Arguments

PATHS

Optional argument(s)