genDocsGPT


NamegenDocsGPT JSON
Version 1.0b17 PyPI version JSON
download
home_pagehttps://github.com/marco-rosner/genDocsGPT
SummaryGenerate API documentation in MarkDown based on the models and api handlers for given project using ChatGPT.
upload_time2023-09-22 15:38:15
maintainer
docs_urlNone
authorMarco Rosner
requires_python>=3.7
licenseMIT
keywords generator documentation gpt chatgpt gendocsgpt openai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![genDocsGPT](https://img.shields.io/pypi/v/genDocsGPT.svg)](https://pypi.org/project/genDocsGPT/) [![Python Versions](https://img.shields.io/badge/Python-3.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11-blue)](https://www.python.org) [![Test workflow](https://github.com/marco-rosner/genDocsGPT/actions/workflows/test.yml/badge.svg)](https://github.com/marco-rosner/genDocsGPT/actions/workflows/test.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT.png?raw=true "genDocsGPT")

## Generate Docs using ChatGPT

CLI to generate API documentation in MarkDown based on the models and api handlers for given project using ChatGPT.

## genDocsGPT badge

[![genDocsGPT](https://img.shields.io/badge/Docs%20generated%20by-genDocsGPT-blue)](https://github.com/marco-rosner/genDocsGPT)

## ChatGPT API Key

The genDosGPT demand a ChatGPT API Key that you can generate after create your free account in [OpenAI](https://www.openai.com/). Tutorial [here](https://www.maisieai.com/help/how-to-get-an-openai-api-key-for-chatgpt). After this, create a `.env` file in the following format:

```
API_KEY="chatgpt_api_Key"
```

## Usage

```
usage: genDocsGPT [-h] [-v, --verbose] -m / --model <model_paths> -a / --api <api_paths> 
[-o / --output <filename>] [-t / --token <token>] [--env <filename>] [--gpt_model <model>]

CLI to generate API documentation in MarkDown based on the models and api handlers for 
given project using ChatGPT.

options:
  -h, --help            show this help message and exit
  -v, --verbose         Show all the messages to debug
  -m / --model <model_paths>
                        Model paths. If more than one, separate with a comma
  -a / --api <api_paths>
                        API paths. If more than one, separate with a comma
  -o / --output <filename>
                        Filename to the documentation generated. Default: ./api.md
  -t / --token <token>  ChatGPT API KEY
  --env <filename>      Env file that MUST and ONLY have API_KEY="chatgpt_api_key". 
                        Default: ./.env
  --gpt_model <model>   Model that will be used by ChatGPT. Default: gpt-3.5-turbo

We do not recommend using it in non-open-source projects.
```

### Standalone

![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-standalone.png?raw=true "genDocsGPT")

The [genDocsGPT.sh](https://github.com/marco-rosner/genDocsGPT/blob/main/usage/Standalone/genDocsGPT.sh), the bash script above, should be used in projects where the documentation should be generated not frequently. You only need to copy this file, **change the configuration** (models, API handlers…), paste it into your project, create the .env file with the ChatGPT API Key, and run this bash script.

I am using this standalone version in the [DadosJusBr’s GraphQL](https://github.com/marco-rosner/dadosjusbr-graphql) project which is a Node/ExpressJS using Apollo Server. So, I created a script in the [package.json](https://github.com/marco-rosner/dadosjusbr-graphql/blob/main/package.json) to run it only using: `npm run genDocsGPT` or `yarn genDocsGPT`

### GitHub Action

![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-gh-action.png?raw=true "genDocsGPT")

This GitHub Action will run after every commit in the main/master branch and create a pull request that you only need to approve (or not) and the documentation will be updated.

For [genDocsGPT.yml](https://github.com/marco-rosner/lightweight-go-server/blob/main/.github/workflows/genDocsGPT.yml) works fine in your project, you should set the model, API handlers paths, and other options ([line 30](https://github.com/marco-rosner/lightweight-go-server/blob/main/.github/workflows/genDocsGPT.yml#L30)), create, in the GitHub, the secret **ChatGPT_API_KEY** ([_tutorial here_](https://docs.github.com/pt/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)), and change the workflow permissions ([_tutorial here_](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions)) to “**Read and Write permissions**” and use the “**Allow GitHub Action to create and approve pull requests**”.

![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-permissions.png?raw=true "Workflow permissions after the changes needed")

For more detail, I integrated this GitHub Action in the [Lightweight Go Server](https://github.com/marco-rosner/lightweight-go-server) project, a [Go servers benchmark between Echo, Gin, and Fiber](https://blog.stackademic.com/go-servers-benchmark-echo-fiber-and-gin-caadd9a78319).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/marco-rosner/genDocsGPT",
    "name": "genDocsGPT",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "generator,documentation,GPT,ChatGPT,genDocsGPT,OpenAI",
    "author": "Marco Rosner",
    "author_email": "marco.rosner@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e1/43/13997ba8670e5b53a3f8fc60beb01b1d5748b9de3d7003f361f9960bae0d/genDocsGPT-1.0b17.tar.gz",
    "platform": null,
    "description": "[![genDocsGPT](https://img.shields.io/pypi/v/genDocsGPT.svg)](https://pypi.org/project/genDocsGPT/) [![Python Versions](https://img.shields.io/badge/Python-3.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11-blue)](https://www.python.org) [![Test workflow](https://github.com/marco-rosner/genDocsGPT/actions/workflows/test.yml/badge.svg)](https://github.com/marco-rosner/genDocsGPT/actions/workflows/test.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT.png?raw=true \"genDocsGPT\")\n\n## Generate Docs using ChatGPT\n\nCLI to generate API documentation in MarkDown based on the models and api handlers for given project using ChatGPT.\n\n## genDocsGPT badge\n\n[![genDocsGPT](https://img.shields.io/badge/Docs%20generated%20by-genDocsGPT-blue)](https://github.com/marco-rosner/genDocsGPT)\n\n## ChatGPT API Key\n\nThe genDosGPT demand a ChatGPT API Key that you can generate after create your free account in [OpenAI](https://www.openai.com/). Tutorial [here](https://www.maisieai.com/help/how-to-get-an-openai-api-key-for-chatgpt). After this, create a `.env` file in the following format:\n\n```\nAPI_KEY=\"chatgpt_api_Key\"\n```\n\n## Usage\n\n```\nusage: genDocsGPT [-h] [-v, --verbose] -m / --model <model_paths> -a / --api <api_paths> \n[-o / --output <filename>] [-t / --token <token>] [--env <filename>] [--gpt_model <model>]\n\nCLI to generate API documentation in MarkDown based on the models and api handlers for \ngiven project using ChatGPT.\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --verbose         Show all the messages to debug\n  -m / --model <model_paths>\n                        Model paths. If more than one, separate with a comma\n  -a / --api <api_paths>\n                        API paths. If more than one, separate with a comma\n  -o / --output <filename>\n                        Filename to the documentation generated. Default: ./api.md\n  -t / --token <token>  ChatGPT API KEY\n  --env <filename>      Env file that MUST and ONLY have API_KEY=\"chatgpt_api_key\". \n                        Default: ./.env\n  --gpt_model <model>   Model that will be used by ChatGPT. Default: gpt-3.5-turbo\n\nWe do not recommend using it in non-open-source projects.\n```\n\n### Standalone\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-standalone.png?raw=true \"genDocsGPT\")\n\nThe [genDocsGPT.sh](https://github.com/marco-rosner/genDocsGPT/blob/main/usage/Standalone/genDocsGPT.sh), the bash script above, should be used in projects where the documentation should be generated not frequently. You only need to copy this file, **change the configuration** (models, API handlers\u2026), paste it into your project, create the .env file with the ChatGPT API Key, and run this bash script.\n\nI am using this standalone version in the [DadosJusBr\u2019s GraphQL](https://github.com/marco-rosner/dadosjusbr-graphql) project which is a Node/ExpressJS using Apollo Server. So, I created a script in the [package.json](https://github.com/marco-rosner/dadosjusbr-graphql/blob/main/package.json) to run it only using: `npm run genDocsGPT` or `yarn genDocsGPT`\n\n### GitHub Action\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-gh-action.png?raw=true \"genDocsGPT\")\n\nThis GitHub Action will run after every commit in the main/master branch and create a pull request that you only need to approve (or not) and the documentation will be updated.\n\nFor [genDocsGPT.yml](https://github.com/marco-rosner/lightweight-go-server/blob/main/.github/workflows/genDocsGPT.yml) works fine in your project, you should set the model, API handlers paths, and other options ([line 30](https://github.com/marco-rosner/lightweight-go-server/blob/main/.github/workflows/genDocsGPT.yml#L30)), create, in the GitHub, the secret **ChatGPT_API_KEY** ([_tutorial here_](https://docs.github.com/pt/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)), and change the workflow permissions ([_tutorial here_](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions)) to \u201c**Read and Write permissions**\u201d and use the \u201c**Allow GitHub Action to create and approve pull requests**\u201d.\n\n![genDocsGPT](https://github.com/marco-rosner/genDocsGPT/raw/main/resources/genDocsGPT-permissions.png?raw=true \"Workflow permissions after the changes needed\")\n\nFor more detail, I integrated this GitHub Action in the [Lightweight Go Server](https://github.com/marco-rosner/lightweight-go-server) project, a [Go servers benchmark between Echo, Gin, and Fiber](https://blog.stackademic.com/go-servers-benchmark-echo-fiber-and-gin-caadd9a78319).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate API documentation in MarkDown based on the models and api handlers for given project using ChatGPT.",
    "version": "1.0b17",
    "project_urls": {
        "Bug Tracker": "https://github.com/marco-rosner/genDocsGPT/issues",
        "Homepage": "https://github.com/marco-rosner/genDocsGPT",
        "repository": "https://github.com/marco-rosner/genDocsGPT"
    },
    "split_keywords": [
        "generator",
        "documentation",
        "gpt",
        "chatgpt",
        "gendocsgpt",
        "openai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f161727c33989e3c5aeb9f7ee6ef56c5ad583942849847478ae02872a733fcf",
                "md5": "fe5875378f17075e49324191c2586084",
                "sha256": "db8744a0e7218f12aa02e7a98d83168c301b234a2574188c619d7d48db894820"
            },
            "downloads": -1,
            "filename": "genDocsGPT-1.0b17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe5875378f17075e49324191c2586084",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11446,
            "upload_time": "2023-09-22T15:38:14",
            "upload_time_iso_8601": "2023-09-22T15:38:14.570819Z",
            "url": "https://files.pythonhosted.org/packages/3f/16/1727c33989e3c5aeb9f7ee6ef56c5ad583942849847478ae02872a733fcf/genDocsGPT-1.0b17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e14313997ba8670e5b53a3f8fc60beb01b1d5748b9de3d7003f361f9960bae0d",
                "md5": "838829fb6ebbee8c2aa40112bddbe8bc",
                "sha256": "657ddca2fe58ee50cd05b447119feb48ec8ceb2e7b3dd879f0abe8662896c855"
            },
            "downloads": -1,
            "filename": "genDocsGPT-1.0b17.tar.gz",
            "has_sig": false,
            "md5_digest": "838829fb6ebbee8c2aa40112bddbe8bc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8127,
            "upload_time": "2023-09-22T15:38:15",
            "upload_time_iso_8601": "2023-09-22T15:38:15.838789Z",
            "url": "https://files.pythonhosted.org/packages/e1/43/13997ba8670e5b53a3f8fc60beb01b1d5748b9de3d7003f361f9960bae0d/genDocsGPT-1.0b17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-22 15:38:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "marco-rosner",
    "github_project": "genDocsGPT",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "gendocsgpt"
}
        
Elapsed time: 0.12719s