Skip to main content

A powerful Python documentation generator that swoops in to automatically create and maintain clean, comprehensive docstrings for your codebase

Project description

DocuGen

A tool for generating documentation from code using LLMs.

CLI Usage

DocuGen provides a command-line interface for generating documentation from your code. The CLI is implemented in cli.py and offers several commands and options.

Basic Usage

python -m docugen [paths...] [options]

Preset Configurations

DocuGen provides preset configurations for popular LLM services:

Ollama Preset

python -m docugen --ollama [paths...]

Uses the following configuration:

OpenAI Preset

python -m docugen --openai -k your_api_key [paths...]

Uses the following configuration:

Gemini Preset

python -m docugen --gemini -k your_api_key [paths...]

Uses the following configuration:

Options

API Configuration

  • -b, --base-url: API base URL for the LLM service
  • -k, --api-key: API key for authentication
  • -m, --model: AI model to use
  • -mc, --max-context: Maximum context size
  • -c, --constraint: Add a documentation constraint (can be used multiple times)
  • -d, --dry-run: Show changes without modifying files
  • -v, --verbose: Enable verbose logging
  • -o, --overwrite: [Dangerous] Overwrite existing docstrings in codebase
  • paths: One or more Python files or directories to process

Examples

# Process a single file
python -m docugen example.py

# Process multiple files with API key
python -m docugen file1.py file2.py -k your_api_key

# Process a directory in dry-run mode
python -m docugen ./src -d

# Process with custom model and verbose logging
python -m docugen ./src -m gpt-4 -v

# Use Ollama preset for local processing
python -m docugen ./src --ollama

# Use OpenAI preset with API key
python -m docugen ./src --openai -k your_api_key

The tool will process the specified Python files, generate documentation using the configured LLM, and update the files with the generated documentation. Use the --dry-run option to preview changes without modifying files.

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

docauto-0.0.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

docauto-0.0.1-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file docauto-0.0.1.tar.gz.

File metadata

  • Download URL: docauto-0.0.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for docauto-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b294056e58ef3e94a4ace20cbba11af36732e6ee7f53a449ea2a49c7a7b64f84
MD5 e0c87c50349a588e2ccb1017db56ee6f
BLAKE2b-256 f1dee105ec4c9475ec884f236aa4797d3833e6e69a312531b0ba56a33661c8e7

See more details on using hashes here.

File details

Details for the file docauto-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: docauto-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for docauto-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 749335f6d7aeea433c30adc24064e97129049b0d645b97bb342fea223b9c23a0
MD5 9a8e58448fea71a414fca0cd59b3fc78
BLAKE2b-256 7b7b53285665c666190b1dd0d379c47d359a42bf3c55f070931dc897987ce29e

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