AutoDoc-ChatGPT  by awekrx

Python script for automated code documentation using ChatGPT

created 2 years ago
395 stars

Top 74.2% on sourcepulse

GitHubView on GitHub
Project Summary

AutoDoc-ChatGPT is a Python script designed to automatically generate documentation for source code files across various programming languages using the ChatGPT API. It targets developers seeking to streamline the documentation process, offering a quick way to create natural language descriptions of code functionality, parameters, and return values.

How It Works

The script processes a given code file, extracts relevant code snippets, and sends them to the ChatGPT API for analysis and documentation generation. It aims to produce detailed descriptions in natural language, acting as a draft for developers to refine. The approach leverages large language models to understand code context and generate human-readable explanations.

Quick Start & Requirements

  • Install: pip install -r requirements.txt
  • Prerequisites: Python 3.x, OpenAI API access (via email/password or session token).
  • Usage: py main.py -file "path/to/your/file"
  • Output: yourfilename_commented.language file is created.
  • Documentation: GitHub Repository

Highlighted Details

  • Supports Python, JavaScript, and TypeScript (with known bugs in JS/TS).
  • Can be used as a Python function for programmatic integration.
  • Requires configuration of ChatGPT credentials (email/password or session token).
  • Generates commented files with a _commented suffix.

Maintenance & Community

  • The project acknowledges acheong08 for ChatGPT creation.
  • No specific community channels or roadmap are detailed in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive for commercial use and closed-source linking.

Limitations & Caveats

The tool does not always produce correct or desired comments and should be used as a draft requiring manual editing. There's a known issue with commenting files containing multiple classes with identically named methods. JavaScript and TypeScript support is still under testing with reported bugs.

Health Check
Last commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.