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.1.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.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docugenius-0.1.1.tar.gz
Algorithm Hash digest
SHA256 65be8f58ea8409229330545818fcd41b4d8080cc6dedaa536ea485b1a5b3a168
MD5 863fc5e1d20b972eb7d3bffeeb9250fa
BLAKE2b-256 72d4056a77a7cd03393cfe80c62a72b219b010d5562ab3ea5b3ef4cbc01dca4a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for docugenius-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 881bbafe2b5ab4a264bb39753e4cef8ceff99cd7786a9eed2371d50100e5e2b9
MD5 787abd6ec77840bed91493de939503bd
BLAKE2b-256 4856c67bd6b88ac1f4df9cc22ad4112354dc57c20077b62e61bd9c394f40fb97

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