Smart Docstrings
Automatically generate NumPy-style docstrings in Python.
Smart Docstrings helps Python developers write consistent, structured documentation with minimal effort.
Features
- Automatically generates docstrings when typing
""".
- Supports Python functions and classes.
- Uses NumPy-style docstring formatting.
- Automatically detects indentation.
- Provides default text for each documentation section.
- Navigate between sections using Tab and Shift+Tab.
- Works alongside GitHub Copilot inline suggestions.
Function Docstrings
When typing """ inside a Python function, Smart Docstrings generates:
def calculate_area(width, height):
"""
Description
----------
__desc__
Parameters
----------
__params__
Returns
-------
__returns__
Raises
------
__raises__
"""
Class Docstrings
When typing """ inside a Python class, Smart Docstrings generates:
class MyClass:
"""
Description
-----------
__desc__
Attributes
----------
__attrs__
Constructors
------------
__init__
Methods
-------
__methods__
private Methods
----------------
__private_methods__
"""
Keyboard Shortcuts
| Shortcut |
Action |
| Tab |
Move to the next section |
| Shift+Tab |
Move to the previous section |
When a section is selected, you can immediately replace its contents.
Requirements
- Visual Studio Code
- Microsoft Python extension
Installation
Install Smart Docstrings from a .vsix package:
- Open Visual Studio Code.
- Open the Extensions panel.
- Select the three-dot menu.
- Choose Install from VSIX....
- Select the Smart Docstrings
.vsix file.
Compatibility
Designed for Python files in Visual Studio Code.
Developer: Mommy-Of-Light
GitHub: https://github.com/Mommy-Of-Light
For bug reports, suggestions, and feature requests, please open a
GitHub Issue.
License
MIT