Welcome to pydocstring’s documentation!¶
Using pydocstring is really simple, just check out the CLI and API.
CLI¶
pydocstring CLI provides entrypoints for CLI commands
Currently only the pydocstring
command is supported
To use pydocstring from the command line you call pydocstring
with the source, and optionally
the position of the cursor within that source (defaults to the end).
Note that pydocstring doesn’t insert docstrings in place (yet), as it’s designed for editor integration. It prints out the generated docstring for the scope the given cursor position is in.
You may also want to provide the -f
flag with the formatter you want to use.
usage: pydocstring [-h] [-f {google,numpy,reST}] [--version] source [position]
positional arguments:
source Source code to process, or the path to a file
position Position of the cursor in the document, defaults to
the end. Row, then column
optional arguments:
-h, --help show this help message and exit
-f {google,numpy,reST}, --formatter {google,numpy,reST}
docstring formatter to use
--version show program's version number and exit
API¶
If you’re looking to use this in an editor you’re probably looking for pydocstring.generate_docstring()
pydocstring |
Top level API - all you need to integrate with an editor, just call pydocstring.generate_docstring() with the source code and the position of your cursor. |
pydocstring.exc |
pydocstring exceptions |
pydocstring.formatters.google |
Google Docstring Formatter |
pydocstring.formatters.numpy |
Numpy Docstring Formatter |
pydocstring.formatters.reST |
reST Docstring Formatter |
pydocstring.cli |
pydocstring CLI provides entrypoints for CLI commands |