Skip to content
/ Pythia Public

Pythia is a tool that automatically analyzes Python files and generates docstrings using a large language model (LLM). Its goal is to streamline code documentation by providing detailed and accurate descriptions of functions and classes directly within the source code, enhancing readability and maintainability.

License

Notifications You must be signed in to change notification settings

MattNot/Pythia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pythia

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.

Features

  • 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.

Installation

To install Pythia, you can use pip:

pip install pythia-suggest

Usage

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/

Command-line Options

  • --overwrite: Overwrite existing docstrings in your files.
  • --style: Specify the docstring style (e.g., Google, NumPy, or reStructuredText).

Example

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

Contributing

We welcome contributions! If you'd like to improve Pythia, please fork the repository and submit a pull request.

License

Pythia is licensed under the MIT License. See the LICENSE file for more details.

About

Pythia is a tool that automatically analyzes Python files and generates docstrings using a large language model (LLM). Its goal is to streamline code documentation by providing detailed and accurate descriptions of functions and classes directly within the source code, enhancing readability and maintainability.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages