Python function documentator using ChatGPT.
Project description
GPT-Documenter
GPT-Documenter is a small project that automates the process of documenting Python functions by using GPT-3.5 along with Langchain.
Installation
-
git clone https://github.com/username/gpt-documenter.git
Usage
GPT-Documenter utilizes Python Typer and provides two main commands:
inspect
document-functions
inspect
The inspect
command allows you to preview the documentation setup and receive an estimate of token usage. To use the inspect
command, provide the following parameters:
project_path
: The path of the project you want to documentoutput_path
: The path where the JSON result will be savedexcluded_paths
: A list of paths you want to avoid, with project_path as root.
Here's an example of how to use the inspect
command:
python main.py inspect /path/to/project /path/to/output.json directory/to/avoid, file_to_avoid.py
document-functions
The document-functions
command generates the actual documentation for the Python functions in your project. You'll need to provide the same arguments as the inspect
command, along with your OpenAI API key:
openai_api_key
: Your OpenAI API keyproject_path
: The path of the project you want to documentoutput_path
: The path where the JSON result will be savedexclude_paths
: A list of paths you want to avoid, with project_path as root.
Here's an example of how to use the document-functions
command:
python main.py document-functions YOUR_API_KEY /path/to/project /path/to/output.json directory/to/avoid, file_to_avoid.py
Once the command is executed, GPT-Documenter will begin generating the documentation for the functions and save the result as a JSON file in the specified output path.
Project details
Release history Release notifications | RSS feed
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 gptdocumenter-0.1.0.tar.gz
.
File metadata
- Download URL: gptdocumenter-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 352a7b3a8a7dcb9bbf2a810f5258b1ed9c64f07edd69226819c333afafa47656 |
|
MD5 | 362d97151f2a2de356c0851c8ba4a19e |
|
BLAKE2b-256 | d90c174d3ecb1420cc254f722f002e06722ec58075af7e7c419fc1a659b7e3de |
File details
Details for the file gptdocumenter-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: gptdocumenter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40df8f58db00795264ae90e8942a2375a1817bf2880661ac9cb51db598024ed9 |
|
MD5 | 2f879633451e5663ceeb953a420d517d |
|
BLAKE2b-256 | 9da02797e2c428024de2cbc87b796fdf6fb00b14e169efd6757e81f233560801 |