Skip to main content

auto-generate documentation for python code using llms

Project description

📝 docullim

Latest Python Versions

auto-generate documentation for python code using llms.

asciicast

⚙️ installation

pip install docullim
poetry add docullim

💻 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.5.0.tar.gz (7.0 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.5.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docullim-0.5.0.tar.gz
  • Upload date:
  • Size: 7.0 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.5.0.tar.gz
Algorithm Hash digest
SHA256 5e1290c956fdf790d3ec624973f830af9c158640ef9d5a690edb0e8067b78600
MD5 3522a876ae5770ff8ff4d3bccded5b28
BLAKE2b-256 19a19a3b40eb1a261b884d923d600a5a43c10bfc8ab68ef9b75d006f115f4423

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docullim-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd7ce6501b70947a40a92672de39402adde9283fe7d4031a29e18f28c6be9d86
MD5 146f7e23185b9097d3ed7c4c28924af1
BLAKE2b-256 e4e7d4f22498428a15350db5df31e5ab3055eed9a6b2073cdb5797884ce0f802

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