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:
- Base URL: http://localhost:11434/v1
- Model: phi4
- Max Context: 16384
OpenAI Preset
python -m docugen --openai -k your_api_key [paths...]
Uses the following configuration:
- Base URL: https://api.openai.com/v1
- Model: gpt-4o-mini
- Max Context: 16384
- Requires API key
Gemini Preset
python -m docugen --gemini -k your_api_key [paths...]
Uses the following configuration:
- Base URL: https://generativelanguage.googleapis.com/v1beta/openai/
- Model: gemini-2.0-flash-exp
- Max Context: 131072
- Requires API key
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 codebasepaths: 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b294056e58ef3e94a4ace20cbba11af36732e6ee7f53a449ea2a49c7a7b64f84
|
|
| MD5 |
e0c87c50349a588e2ccb1017db56ee6f
|
|
| BLAKE2b-256 |
f1dee105ec4c9475ec884f236aa4797d3833e6e69a312531b0ba56a33661c8e7
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
749335f6d7aeea433c30adc24064e97129049b0d645b97bb342fea223b9c23a0
|
|
| MD5 |
9a8e58448fea71a414fca0cd59b3fc78
|
|
| BLAKE2b-256 |
7b7b53285665c666190b1dd0d379c47d359a42bf3c55f070931dc897987ce29e
|