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
Built Distribution
File details
Details for the file gpt_readme-0.1.2.tar.gz
.
File metadata
- Download URL: gpt_readme-0.1.2.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c18163db792c4c11569a1ed4a939d18a8c641600561bfb4a2721ff3c9ceba2a |
|
MD5 | 34965d622f1c7cb6aa321327d67ab4fd |
|
BLAKE2b-256 | 2681ae6da2b9f05675962136156f4378330b24e49c072dcdb8d8b6157f888436 |
File details
Details for the file gpt_readme-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: gpt_readme-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 461b0e8b415cdfec2d0ed586584d3de3775385dfb4e142dba46c9ead45e14662 |
|
MD5 | 6daa47fab0f6e45a7af4f0275faf3449 |
|
BLAKE2b-256 | 9136215951a83b942b0d71825237fb32be2a1cd07f9a693e05df12634868c745 |