Skip to main content

auto-generate documentation for python code using llms

Project description

📝 docullim

auto-generate documentation for python code using llms.

asciicast

💻 usage

add @docullim to the function or class you want to generate documention for. you can also pass a tag to the annotation like @docullim("custom_tag").

from docullim import docullim

@docullim
def add(a, b):
    return a + b

@docullim("custom_tag")
def sub(a, b):
    return a - b
docullim file1.py file2.py
docullim "src/**/*.py"
docullim --config docullim.json --model gpt-4 "src/**/*.py"
docullim --reset-cache --concurrency 3 --write file1.py "src/**/*.py"

config file is a json file that can have model as string, max_concurrency as number or prompts as string pairs.

docullim.json

{
  "model": "gpt-4",
  "max_concurrency": 5,
  "prompts": {
    "default": "Generate short and simple documentation explaing the code and include sample usage.",
    "custom_tag": "this is a a diffrent propmt being passed to the llm when @docullim('custom_tag') is passed"
  }
}

you should provide your llm api key provided as enviroment variable by default it requires OPENAI_API_KEY. you can switch models and provide other llm api keys. See supported llms

🛠️ development

Install the following tools are needed to have this project running

  • devbox manages all the packages needed by the project
  • direnv loads env variables and run devbox when in project directory

also rename .env.example to .env and add your llm api key.

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

docullim-0.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

docullim-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file docullim-0.2.0.tar.gz.

File metadata

  • Download URL: docullim-0.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.8 Darwin/24.3.0

File hashes

Hashes for docullim-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ede006e5e717ac610e17c606f27d085818fd70faa8a1910cf5677af2d60fa070
MD5 63582be7b2ca01bd4fd3069cd4e9ee50
BLAKE2b-256 9b1a45cc477e33f32dbd23e37e02120478cbb65695be00175dbf1f70607c1dc2

See more details on using hashes here.

File details

Details for the file docullim-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: docullim-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.8 Darwin/24.3.0

File hashes

Hashes for docullim-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b7a5c0023397e14e2f396b15cb903d0d8d1c5ce68c4d52514b1fa66332b4f39
MD5 f8197152b2aa801da885045fd96b7b8b
BLAKE2b-256 fa4ac7ffc107caec9d5f1e0a5dad305c0bc1934c5fba3798bb482e23a033aa54

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