AutoDoc-ChatGPT  by awekrx

Python script for automated code documentation using ChatGPT

Created 2 years ago
395 stars

Top 72.9% 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
1 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

BMTools by OpenBMB

0%
3k
Tool-learning framework for extending language models with external tools
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.