Skip to main content

Dragula

Dragula (D-RAG-ula) is a Python library that indexes a Python codebase and serves a local web UI for AI-generated object documentation over pluggable LLM providers.

Features

  • CLI commands: init, index, serve
  • AST-based symbol extraction (module/class/function/method)
  • SQLite storage for structured symbol data
  • ChromaDB storage for semantic chunk vectors
  • FastAPI web UI to browse symbols and request AI descriptions (also available via HTTP API)

Install

Requires Python 3.11+.

pip install dragula

Configuration

Dragula keeps its config and local databases under <project_root>/.dragula/ (fixed location, similar in spirit to an Alembic env directory).

Initialize once in the target project (creates .dragula/, a template config.ini, SQLite tables, and the Chroma data directory):

dragula init .

Edit .dragula/config.ini for your LLM providers.

Minimal Gemini config

[app]
top_k = 6

[chat]
provider = gemini
model = gemini-2.5-flash
api_key = ${GEMINI_API_KEY}
base_url =
timeout_seconds = 60

[embedding]
provider = gemini
model = gemini-embedding-001
api_key = ${GEMINI_API_KEY}
base_url =
timeout_seconds = 60

Mixed providers (chat remote, embedding local)

[app]
top_k = 6

[chat]
provider = gemini
model = gemini-2.5-flash
api_key = ${GEMINI_API_KEY}
base_url =
timeout_seconds = 60

[embedding]
provider = openai_compatible
model = text-embedding-3-small
base_url = http://localhost:11434/v1
api_key =
timeout_seconds = 60

Usage

Initialize (first time only):

dragula init .

Build index:

dragula index .

Run web UI (default http://127.0.0.1:8000):

dragula serve .

Optional server binding:

dragula serve . --host 0.0.0.0 --port 8080

HTTP API

Method Path Purpose
GET / Web UI
GET /api/symbols List symbols
GET /api/symbols/{symbol_id} Symbol details and chunks
POST /api/symbols/{symbol_id}/describe Generate AI description
DELETE /api/symbols/{symbol_id}/descriptions Clear cached descriptions for a symbol

Data layout

Under the project root:

  • .dragula/config.ini — configuration
  • .dragula/symbols.sqlite3 — structured symbol/chunk/description tables
  • .dragula/chroma/ — Chroma persistent vector store

Metadata

Release files for dragula 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dragula 0.0.1
File Size Uploaded
dragula-0.0.1.tar.gz 29.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dragula 0.0.1
File Interpreter ABI Platform
dragula-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 61.7 kB

Release files / dragula-0.0.1.tar.gz

Download URL dragula-0.0.1.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
adbe656ae0eaf56a23a70e4b01e3c798f1995173284b3a08365849efedd62ae5
BLAKE2b-256 checksum
How to use checksums
51724ab333ef9609fcff566ab40b7b8238d5984ce939b868b6735989b995ba6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Release files / dragula-0.0.1-py3-none-any.whl

Download URL dragula-0.0.1-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3b5987b483ebc3376728a840aab7d454386a54882136fad002d2cc1198d6798
BLAKE2b-256 checksum
How to use checksums
f3342f441ccd1037d98507029d9b58d828907c55ec775b34d2ceaa9c9081cb13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page