Skip to main content

Generate docustrings in seconds

Project description

Docugenius

Docugenius is a tool that generates documentation for your python code using LLMs. The library provides a simple CLI interface to generate documentation for your python code.

Installation

pip install docugenius

Quickstart

Before running docugenius, make sure you exported your OpenAI API key as an environment variable.

export OPENAI_API_KEY="your-api-key"

To generate documentation for your python code, run the following command:

docugenius path/to/python/code.py

The default model used is OpenAI openai:gpt-4o, but you can specify a different model using the --model flag.

docugenius path/to/python/code.py --model openai:gpt-4-mini

See the Supported Models section for a list of supported models. Supported Models

If you want to run docugenius on an entire directory, you can pass the directory path as input.

docugenius path/to/python/directory

CLI Usage

usage: docugenius [-h] [--model {openai:gpt-4o,openai:gpt-4o-mini}] [--docstring-format {google,numpy,sprinx}] [--skip-raises] [--skip-returns]
                  [--skip-examples] [--output-path OUTPUT_PATH]
                  input_path

positional arguments:
  input_path            The path to the input. You can also pass a directory to process all files in it.

options:
  -h, --help            show this help message and exit
  --model {openai:gpt-4o,openai:gpt-4o-mini}, -m {openai:gpt-4o,openai:gpt-4o-mini}
                        The model to use for generating docstrings.
  --docstring-format {google,numpy,sprinx}, -d {google,numpy,sprinx}
                        The format of the generated docstrings.
  --skip-raises, -r     Whether to include information about exceptions raised by the code.
  --skip-returns, -R    Whether to include information about the return value of the code.
  --skip-examples, -e   Whether to include examples of how to use the code.
  --output-path OUTPUT_PATH, -o OUTPUT_PATH
                        The path to the output file/destination. If not provided, the output will overwrite the input file. If a directory is passed as
                        input, this should be a directory.

The output overwrites the input file. If you want to save the output to a different file, you can use the --output-path flag.

docugenius path/to/python/code.py --output path/to/output/file.py

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

docugenius-0.1.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docugenius-0.1.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file docugenius-0.1.3.tar.gz.

File metadata

  • Download URL: docugenius-0.1.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for docugenius-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e77af8944265f74dc57bf5530096ba231d85d45624f50fa744ef832f7b498e98
MD5 c3dc1ce3acb4c4741787a8fbc8c22c9c
BLAKE2b-256 158c0cda5156aa5f0c32951a7514fabf9396376c04c87980267490a94157f4e8

See more details on using hashes here.

File details

Details for the file docugenius-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: docugenius-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for docugenius-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd6d68541e05ccead7721bfd8a28e11ff0f30fe724963a81c88d3a0e389d4d25
MD5 4329c5bca76d136123d447be1075cdba
BLAKE2b-256 194bf7798535f8647fc8eba01fc47d97e2324f19dd1d49590b47301631270504

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page