Skip to main content

codedocent

Code visualization for non-programmers.

A docent is a guide who explains things to people who aren't experts. Codedocent does that for code.

The problem

You're staring at a codebase you didn't write — maybe thousands of files across dozens of directories — and you need to understand what it does. Reading every file isn't realistic. You need a way to visualize the code structure, get a high-level map of what's where, and drill into the parts that matter without losing context.

Codedocent parses the codebase into a navigable, visual block structure and explains each piece in plain English. It's an AI code analysis tool — use a cloud provider for speed or run locally through Ollama for full privacy. Point it at any codebase and get a structural overview you can explore interactively, understand quickly, and share as a static HTML file.

What's new in v1.0.0

Architecture Mode

Architecture mode — dependency graph showing files as nodes with directed edges

Visualize your codebase as a zoomable dependency graph. Three levels of detail:

  • Level 0 — Modules: See all modules as nodes with dependency edges between them
  • Level 1 — Files: Drill into a module to see its files and their internal + external dependencies
  • Level 2 — Code: Click through to the existing CodeDocent file view (functions, classes, complexity)

Export MD button at each level generates structured context you can feed to AI tools.

codedocent /path/to/code --arch    # jump straight to architecture view

Or choose option 4 in the setup wizard.

Enhanced AI Summaries

Enhanced AI summary showing ROLE, SUMMARY, and KEY CONCEPTS for parser.py

AI analysis now understands where each file sits in the system:

  • Dependency context — the prompt tells the AI what this file imports and what imports it
  • ROLE — what job does this code do? Foundation, orchestrator, utility, entry point?
  • KEY CONCEPTS — main functions, classes, and data structures with one-line descriptions
  • Better prompts — explains code in terms of data flow and system role, not just syntax

Who this is for

  • Developers onboarding onto an unfamiliar codebase — get oriented in minutes instead of days
  • Non-programmers (managers, designers, PMs) who need to understand what code does without reading it
  • Solo developers inheriting legacy code — map out the structure before making changes
  • Code reviewers who want a high-level overview before diving into details
  • Security reviewers who need a structural map of an application
  • Students learning to read and navigate real-world codebases

What you see

Nested, color-coded blocks representing directories, files, classes, and functions — the entire structure of a codebase laid out visually. Each block shows a plain English summary, key concepts, pseudocode, and quality warnings. Click any block to drill down; breadcrumbs navigate you back up. You can export code from any block or paste replacement code back into the source file.

In architecture mode, a D3.js force-directed graph shows modules and files as nodes with directed dependency edges. Click any node to drill deeper.

Install

pip install codedocent

Requires Python 3.10+. Cloud AI needs an API key set in an env var (e.g. OPENAI_API_KEY). Local AI needs Ollama running. --no-ai skips AI entirely.

Quick start

codedocent                         # setup wizard — walks you through everything
codedocent /path/to/code           # interactive mode (recommended)
codedocent /path/to/code --arch    # architecture mode — dependency graph
codedocent /path/to/code --full    # full analysis, static HTML output
codedocent --gui                   # graphical launcher
codedocent /path/to/code --cloud openai    # use OpenAI
codedocent /path/to/code --cloud groq      # use Groq
codedocent /path/to/code --cloud custom --endpoint https://my-llm/v1/chat/completions

GUI launcher

GUI launcher with folder picker, AI backend toggle, model dropdown, and mode selector

If you prefer clicking over typing, codedocent --gui opens a graphical launcher. Pick a folder, choose your AI backend (cloud or local Ollama), select a model, and choose a mode — Interactive, Full export, Text tree, or Architecture. Hit Go.

codedocent --gui

How it works

Parses code structure with tree-sitter, scores quality with static analysis, and sends individual blocks to a cloud AI provider or local Ollama model for plain English summaries and pseudocode. Interactive mode analyzes on click — typically 1-2 seconds per block. Full mode analyzes everything upfront into a self-contained HTML file you can share. Architecture mode builds a dependency graph from import statements and renders it as a zoomable D3 visualization.

AI options

  • Cloud AI — send code to OpenAI, OpenRouter, Groq, or any OpenAI-compatible endpoint. Fast, no local setup. Your code is sent to that service. API keys are read from env vars (OPENAI_API_KEY, OPENROUTER_API_KEY, GROQ_API_KEY, CODEDOCENT_API_KEY for custom endpoints).
  • Local AI — Ollama on your machine. Code never leaves your laptop. No API keys, no accounts.
  • No AI (--no-ai) — structure and quality scores only.

The setup wizard (codedocent with no args) walks you through choosing.

Supported languages

Full AST parsing for Python and JavaScript/TypeScript (functions, classes, methods, imports). File-level detection for 23 extensions including C, C++, Rust, Go, Java, Ruby, PHP, Swift, Kotlin, Scala, HTML, CSS, and config formats.

License

MIT

Metadata

Release files for codedocent 1.0.3

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

Source distribution (sdist)

Source distribution for codedocent 1.0.3
File Size Uploaded Provenance Actions
codedocent-1.0.3.tar.gz 74.5 kB Without provenance Details for codedocent-1.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 134.5 kB

Release files / codedocent-1.0.3.tar.gz

Download URL codedocent-1.0.3.tar.gz
Size 74.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a309a9262a60b17feed75bdfe44cf8c6832d25d71df6050107b78835f933a041
BLAKE2b-256 checksum
How to use checksums
79607dec3ee07e260c5b60a72883076245c27aca261503b415575b312967a156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / codedocent-1.0.3-py3-none-any.whl

Download URL codedocent-1.0.3-py3-none-any.whl
Size 60.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53e1438a8ad0ddbd0b606b1d44aee3f9228db86aa72b6751c0b49be9fd44f9aa
BLAKE2b-256 checksum
How to use checksums
31e37f024ba968be8b5c9f0ceae198baeaf77258d2e7f70691352ac25eae7c62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for codedocent 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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