Skip to main content

Generate Python docstrings automatically with LLM and syntax trees.

Project description

llm-docsmith

Generate Python docstrings automatically with LLM and syntax trees.

Installation

Install this plugin in the same environment as LLM.

llm install llm-docsmith

Usage

Pass a Python file as argument to llm docsmith:

llm docsmith ./scripts/main.py

The file will be edited to include the generated docstrings.

Options:

  • -m/--model: Use a model other than the configured LLM default model
  • -o/--output: Only show the modified code, without modifying the file
  • -v/--verbose: Verbose output of prompt and response
  • --git: Only update docstrings for functions and classes that have been changed since the last commit
  • --git-base: Git reference to compare against (default: HEAD)
  • --only-missing: Only add docstrings to functions and classes that don't have them yet

Only Missing Mode

The --only-missing flag tells docsmith to only generate docstrings for functions and classes that don't already have one. This is useful when you want to preserve existing docstrings and only add documentation where it's missing:

# Only add docstrings where they are missing
llm docsmith ./scripts/main.py --only-missing

Git Integration

The --git flag enables Git integration, which will only update docstrings for functions and classes that have been changed since the last commit. This is useful for large codebases where you only want to update docstrings for modified code.

# Update docstrings only for changed functions and classes
llm docsmith ./scripts/main.py --git

It's also possible to compare against a different git reference to find changed, for instance the main branch:

# Compare against a specific Git reference
llm docsmith ./scripts/main.py --git --git-base main

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

llm_docsmith-0.3.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

llm_docsmith-0.3-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_docsmith-0.3.tar.gz.

File metadata

  • Download URL: llm_docsmith-0.3.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_docsmith-0.3.tar.gz
Algorithm Hash digest
SHA256 4b275ba7ced6f64eb26af5e649ff5f419332b099cab39343d95bc43f2bb80dc7
MD5 4bfeac8d49ea09ba42c72647513cf210
BLAKE2b-256 ce41bff8d8f6bfe1726063e80e60ccf8b309c19e1ba231e2748357a1d85dbad3

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_docsmith-0.3.tar.gz:

Publisher: publish.yml on mathpn/llm-docsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_docsmith-0.3-py3-none-any.whl.

File metadata

  • Download URL: llm_docsmith-0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_docsmith-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1e419dc768489fcb1aa4d534b7f9c2ea9f8edf987c4c33cd4a9a8decce524d23
MD5 d363c25cd100a0851442aaa3db4d8beb
BLAKE2b-256 ca82d42c9f10cf786f50c814a485075d36d15074487db1f84e6cb09c92b59288

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_docsmith-0.3-py3-none-any.whl:

Publisher: publish.yml on mathpn/llm-docsmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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