Code intelligence engine — extract symbols, references, and structure from codebases using tree-sitter
Project description
codeglass
Code intelligence engine — extract symbols, references, import graphs, call graphs, type hierarchies, and structural outlines from codebases using tree-sitter.
Language-agnostic core with per-language plugins. 7 languages supported out of the box.
Quick Start
pip install codeglass
from pylens import CodeLens
lens = CodeLens()
# Get all symbols from a file
outline = lens.get_symbols("src/main.py")
for sym in outline.symbols:
print(f"{sym.kind:10} {sym.name:30} line {sym.line}")
# Get the import graph of a project
graph = lens.get_import_graph("src/")
print(f"{graph.stats.total_files} files, {graph.stats.total_imports} imports")
# Find what a function calls
calls = lens.get_call_graph("handle_request", "src/server.py", 42)
for callee in calls.callees:
print(f" → {callee.name} (line {callee.resolved_line})")
# Get the class hierarchy
hierarchy = lens.get_type_hierarchy("src/")
for name, node in hierarchy.types.items():
if node.subclasses:
print(f"{name} → {', '.join(node.subclasses)}")
Features
| Operation | Description | Deterministic |
|---|---|---|
get_symbols |
Extract functions, classes, methods with signatures and docstrings | ✅ |
get_references |
Find all usages of a symbol across a codebase | ⚠️ cross-file: best-effort |
get_outline |
Recursive directory tree with per-file symbol summaries | ✅ |
get_import_graph |
Full import graph: imports, imported_by, stats, orphans | ✅ |
get_call_graph |
Callees — what does this function call? | ✅ |
get_test_coverage |
Find test files and match test functions to source symbols | ⚠️ file matching: heuristic |
get_type_hierarchy |
Class inheritance graph with bases, subclasses, abstract detection | ✅ |
find_similar |
Find structurally similar functions via AST fingerprinting | ✅ |
Supported Languages
Python, JavaScript, TypeScript, Go, Rust, C/C++, Ruby
Adding a new language takes ~30 lines of tree-sitter queries.
Documentation
Requirements
- Python 3.11+
- tree-sitter 0.20.x
- tree-sitter-languages 1.10+
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codeglass-0.1.1.tar.gz.
File metadata
- Download URL: codeglass-0.1.1.tar.gz
- Upload date:
- Size: 55.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a4bf7b8e8f38480f5bb2f1aa904721dbce51624b0086a0b5ff2e2e04c53ae09
|
|
| MD5 |
52501109076923d1245e92323518c765
|
|
| BLAKE2b-256 |
6a0de6f830937461ff58a7369abc77bdc428e5b8a1df90e9321d1995442adb5f
|
File details
Details for the file codeglass-0.1.1-py3-none-any.whl.
File metadata
- Download URL: codeglass-0.1.1-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bfa1ca7496e8b2e8e87d93a0336fc198e5c91d4e2795a0e3cdaf92d5da921ab
|
|
| MD5 |
736b13c3dd9e9cd98743481f4e46e443
|
|
| BLAKE2b-256 |
6fd506b6a3dc707eced223dfc69e05e705313e2c6a37d2c090569b02324d6a9e
|