Skip to main content

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:

  1. inspect
  2. 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 document
  • output_path: The path where the JSON result will be saved
  • excluded_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 key
  • project_path: The path of the project you want to document
  • output_path: The path where the JSON result will be saved
  • exclude_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


Download files

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

Source Distribution

gptdocumenter-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

gptdocumenter-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

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

Hashes for gptdocumenter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 352a7b3a8a7dcb9bbf2a810f5258b1ed9c64f07edd69226819c333afafa47656
MD5 362d97151f2a2de356c0851c8ba4a19e
BLAKE2b-256 d90c174d3ecb1420cc254f722f002e06722ec58075af7e7c419fc1a659b7e3de

See more details on using hashes here.

File details

Details for the file gptdocumenter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gptdocumenter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40df8f58db00795264ae90e8942a2375a1817bf2880661ac9cb51db598024ed9
MD5 2f879633451e5663ceeb953a420d517d
BLAKE2b-256 9da02797e2c428024de2cbc87b796fdf6fb00b14e169efd6757e81f233560801

See more details on using hashes here.

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