Pythia is a tool designed to automatically generate docstrings for Python files using the power of large language models (LLMs). By analyzing your Python code, Pythia Suggest creates detailed and accurate documentation for functions and classes, making your code more understandable and maintainable.
- Automatic Docstring Generation: Pythia scans your Python files and generates informative docstrings for functions and classes.
- Large Language Model Integration: Leverages state-of-the-art LLMs to create high-quality, human-readable docstrings.
- Customizable: You can configure docstring formats to match your preferred style.
- Easy to Use: Simple command-line interface (CLI) to generate docstrings for your entire project or specific files.
To install Pythia, you can use pip
:
pip install pythia-suggest
After installing, you can generate docstrings for a Python file or an entire directory with the following commands:
# Generate docstrings for a specific Python file
pythia-suggest generate myfile.py
# Generate docstrings for all Python files in a directory
pythia-suggest generate ./myproject/
--overwrite
: Overwrite existing docstrings in your files.--style
: Specify the docstring style (e.g., Google, NumPy, or reStructuredText).
Before running Pythia:
def add_numbers(a, b):
return a + b
After running Pythia:
def add_numbers(a, b):
"""
Adds two numbers together.
Args:
a (int): The first number.
b (int): The second number.
Returns:
int: The sum of the two numbers.
"""
return a + b
We welcome contributions! If you'd like to improve Pythia, please fork the repository and submit a pull request.
Pythia is licensed under the MIT License. See the LICENSE file for more details.