Skip to main content

Use ChatGPT to generate a well-formatted README based on your code

Project description

This readme is generated by command:

gpt-readme --demand let user know gpt-readme is a shell command. use gpt-readme for the commandline usage, not the python call. You must detail commandline usage of gpt-readme. Detail the installation process. Let user know they can install gpt-readme from pip, or from source github repo gusye1234/gpt-readme --agree 

gpt-readme

Introduction

The gpt-readme module is designed to automate the generation of well-formatted README files for code repositories using OpenAI's language model. It streamlines the documentation process for developers by summarizing directories and files based on specified parameters, making it easier to create comprehensive documentation for projects.

Get Started

To install gpt-readme, you can choose one of the following methods:

Installation via pip

You can install gpt-readme directly from PyPI using pip:

pip install gpt-readme

Installation from Source

Alternatively, you can clone the GitHub repository and install it from source:

git clone https://github.com/gusye1234/gpt-readme.git
cd gpt-readme
pip install .

Command-line Usage

Once installed, you can use the gpt-readme command to generate a README file. Here is the command format:

gpt-readme --path <repo_path> --exts <extensions> --max_dir_entity <number> --language <lang> --model <model> --demand <requirements> --out <output_path> --cache <0 or 1> --agree

Options:

  • --path: Path to the repository.
  • --exts: File extensions to include.
  • --max_dir_entity: Maximum number of directory entities to process.
  • --language: Programming language of the code.
  • --model: OpenAI model to use.
  • --demand: Specific requirements for the README.
  • --out: Output path for the generated README.
  • --cache: Enable or disable caching (0 or 1).
  • --agree: Agreement flag for terms.

Feature

The gpt-readme module supports the following main features:

  • Directory Summarization: Recursively summarizes directories and files, providing an overview of the project structure.
  • File Summarization: Generates summaries for individual code files, enhancing the understanding of code functionality.
  • Customizable Output: Allows users to specify various parameters to tailor the README generation to their needs.

Use Cases

  • Developers looking to quickly generate documentation for their projects.
  • Teams needing consistent and structured README files for better collaboration.
  • Open-source contributors wanting to enhance the visibility and usability of their repositories.

Implementation

The gpt-readme module consists of several files, each serving distinct purposes:

  • setup.py: Configures the package and its dependencies.
  • gpt_readme/__init__.py: Initializes the package and imports the main functionality.
  • gpt_readme/__main__.py: Entry point for executing the application.
  • gpt_readme/constants.py: Contains constants and configurations for the module.
  • gpt_readme/dir_summary.py: Implements directory summarization using OpenAI's API.
  • gpt_readme/file_summary.py: Summarizes individual code files and caches results.
  • gpt_readme/llm.py: Provides an asynchronous interface to OpenAI's API.
  • gpt_readme/main.py: Implements the command-line tool for generating README files.
  • gpt_readme/prompts.py: Contains prompt templates for structured documentation.
  • gpt_readme/utils.py: Offers utility functions for various operations.

Acknowledgement

The gpt-readme module utilizes several third-party libraries:

  • openai: For interacting with OpenAI's API to generate text completions.
  • asyncio: For handling asynchronous operations within the module.
  • argparse: For parsing command-line arguments.
  • rich: For enhanced console output, providing a better user experience.

Thank you for using gpt-readme to simplify your README generation process!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpt_readme-0.1.2.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distribution

gpt_readme-0.1.2-py3-none-any.whl (12.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page