Add or improve docstrings for Python functions and classes.
Generate or enhance Python docstrings for functions and classes with support for Google, NumPy, and Sphinx styles. Use it when you need to add documentation to existing code or improve incomplete docstrings.
/plugin marketplace add varaku1012/aditi.code/plugin install auto-docs@aditi-code-pluginsAdd or improve docstrings for Python functions and classes.
/docs-docstrings src/pipelines/ # Add to all files
/docs-docstrings src/agents/screenwriter.py # Specific file
/docs-docstrings --style numpy # Use NumPy style
/docs-docstrings --missing-only # Only add missing
def process_video(
frames: list[Path],
config: VideoConfig,
) -> VideoOutput:
"""Process frames into video output.
Takes a sequence of frame images and generates
a complete video file using the specified configuration.
Args:
frames: List of paths to frame images.
config: Video generation configuration including
resolution, framerate, and codec settings.
Returns:
VideoOutput containing the path to the generated
video and associated metadata.
Raises:
ValueError: If frames list is empty.
FileNotFoundError: If any frame file doesn't exist.
EncodingError: If video encoding fails.
Example:
>>> frames = [Path("frame1.png"), Path("frame2.png")]
>>> config = VideoConfig(fps=24)
>>> output = process_video(frames, config)
>>> print(output.video_path)
"""
def process_video(frames, config):
"""
Process frames into video output.
Parameters
----------
frames : list of Path
List of paths to frame images.
config : VideoConfig
Video generation configuration.
Returns
-------
VideoOutput
Generated video output with metadata.
Raises
------
ValueError
If frames list is empty.
Examples
--------
>>> output = process_video(frames, config)
"""
def process_video(frames, config):
"""
Process frames into video output.
:param frames: List of paths to frame images.
:type frames: list[Path]
:param config: Video generation configuration.
:type config: VideoConfig
:returns: Generated video output.
:rtype: VideoOutput
:raises ValueError: If frames is empty.
"""
Parse function signature
Analyze implementation
Generate docstring
--missing-onlyOnly add docstrings to undocumented code.
--improveEnhance existing docstrings without overwriting.
--include-privateDocument private functions (_prefix).
--dry-runPreview changes without writing.
In pyproject.toml:
[tool.auto-docs]
docstring_style = "google"
include_examples = true
include_types = true
line_length = 88