Skip to main content

Module code_tree

Module code_tree 

Source
Expand description

Code-tree: parse polyglot codebases into KGLite knowledge graphs.

Tree-sitter grammars are compiled into the kglite crate’s extension surface — no optional dependencies.

Entry points:

The PyO3 wrapper crate (kglite-py) exposes these as kglite.code_tree.build etc.

Modules§

builder
Builder: orchestrates parse → model → load phases.
cross_lang
Cross-language HTTP boundary edges — links client calls to server routes. Cross-language HTTP boundary edges (Phase C.1).
docs
Optional docs pass — ingests a repo’s markdown as :Doc nodes and links them to code symbols. Reuses the OKF parser, so it’s gated on the okf feature. Optional docs pass for code_tree.
manifest
Project manifest readers — pyproject.toml, Cargo.toml.
models
Data models for parsed code entities (ported from parsers/models.py).
parsers
Language parsers: one file per language grammar.
repo
GitHub shallow-clone helper (ported from repo.py).
rev
Build a code graph from a git revision (git-archive → tempdir → build), without disturbing the working tree. Exposed as code_tree.build(rev=…). Build a code graph from a git revision without disturbing the working tree.