Use ChatGPT to generate a well-formatted README based on your code
Project description
This readme generated by command: gpt-readme --path="./gpt_readme" --demand="gpt-readme is a shell tool that should be used in commandline. Add detailed commandline usage of gpt-readme. Let user know they can install gpt-readme from pip, or from source github repo gusye1234/gpt-readme" --language="english"
gpt-readme
Introduction
The gpt-readme
module is a Python package that automates the process of generating informative and well-structured README files for code repositories. It uses the OpenAI GPT-3.5 Turbo model to generate summaries based on code and module descriptions. With gpt-readme
, developers can easily create README documentation that provides a clear overview of their codebase.
Get Started
To install gpt-readme
, you can use either of the following methods:
-
Install from pip:
pip install gpt-readme
-
Install from source (GitHub repository: gusye1234/gpt-readme):
git clone https://github.com/gusye1234/gpt-readme.git cd gpt-readme python setup.py install
Once installed, you can use the gpt-readme
command in the command line to generate README files. The available command-line options are:
gpt-readme [--path PATH] [--exts EXTS] [--language LANGUAGE] [--demand DEMAND] [--out OUT] [--cache CACHE]
--path
: The local path for the code repository or file (default: "./")--exts
: Select the code extension names, separated by commas (default: "py,cpp")--language
: Select the readme language (default: "english")--demand
: Additional requirements for the gpt-readme (default: "No false summary is allowed")--out
: Select where the readme file should be saved (default: "./readme.md")--cache
: Cache the code summary to speed up future generation (default: True)
Features
- Automatic generation of README documentation for code repositories
- Summarization of code files and directories using the OpenAI GPT-3.5 Turbo model
- Customizable code extension selection
- Support for multiple readme languages
- Ability to specify additional requirements for the generated summaries
- Caching of code summaries for faster generation
Implementation
The gpt-readme
module consists of the following files and submodules:
__init__.py
: Provides information about the version, author, and URL of thegpt-readme
package.__main__.py
: Serves as the entry point for the code and executes themain
function.constants.py
: Defines variables and a function related to the GPT-Readme project, such as mappings between file extensions and programming languages.dir_summary.py
: Responsible for summarizing directories and their contents using the OpenAI GPT-3.5 Turbo model.file_summary.py
: Provides functionality for summarizing code files using the OpenAI GPT-3.5 Turbo model.main.py
: Generates README files using ChatGPT based on code and provides a command-line interface for specifying code repositories, file extensions, readme language, and additional requirements.prompts.py
: Stores predefined prompts for generating README documentation for code modules and files.utils.py
: Provides utility functions for thegpt-readme
codebase, such as environment setup, cache management, content hashing, language detection, and prompt/summary construction.
Acknowledgement
The gpt-readme
module relies on the following third-party libraries:
os
: Provides functions for file and path operations.openai
: Enables interaction with the OpenAI GPT-3.5 Turbo model.sys
: Provides access to some variables used or maintained by the interpreter.rich.console
: Offers rich text rendering capabilities in the console.argparse
: Facilitates command-line argument parsing.rich.markdown
: Renders Markdown content.json
: Handles JSON data.hashlib
: Provides hashing algorithms.getpass
: Allows secure password input.
Special thanks to the developers of these libraries for their contributions to the gpt-readme
module.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.