Static analysis tool that maps the hidden network of connections in codebases
Project description
Mycelium
Static analysis CLI that maps the connections in a source code repository. Produces a single JSON file containing file structure, symbols, imports, call graph, community clusters, and execution flows.
Install
uvx mycelium-map
Or install locally:
pip install mycelium-map
Usage
mycelium-map analyze <path> # Analyse a repo
mycelium-map analyze <path> -o output.json # Custom output path
mycelium-map analyze <path> --verbose # Show phase timing breakdown
mycelium-map analyze <path> --quiet # No terminal output
mycelium-map analyze <path> -l cs,ts # Only analyse C# and TypeScript
mycelium-map analyze <path> --exclude vendor,legacy # Skip directories
mycelium-map analyze <path> --resolution 1.5 # Louvain resolution (higher = more communities)
mycelium-map analyze <path> --max-processes 50 # Limit execution flows
mycelium-map analyze <path> --max-depth 8 # Limit BFS trace depth
Default output file: <repo-name>.mycelium.json
Supported Languages
| Language | Extensions |
|---|---|
| C# | .cs |
| VB.NET | .vb (requires grammar build) |
| TypeScript | .ts, .tsx |
| JavaScript | .js, .jsx, .mjs, .cjs |
| Python | .py |
| Java | .java |
| Go | .go |
| Rust | .rs |
| C | .c, .h |
| C++ | .cpp, .cc, .cxx, .hpp, .hxx, .hh |
Output Schema
The JSON output contains these top-level sections:
metadata
{
"repo_name": "my-project",
"repo_path": "/absolute/path",
"analysed_at": "2026-02-05T18:33:12Z",
"mycelium_version": "0.1.0",
"commit_hash": "a1b2c3d4e5f6",
"analysis_duration_ms": 42.3,
"phase_timings": { "structure": 0.004, "parsing": 0.001, ... }
}
stats
Summary counts: files, folders, symbols, calls, imports, communities, processes, and a languages breakdown by file count.
structure
File tree with language, size, and line counts.
{
"files": [{ "path": "src/main.cs", "language": "cs", "size": 1024, "lines": 45 }],
"folders": [{ "path": "src/", "file_count": 3 }]
}
symbols
Every extracted symbol: classes, methods, interfaces, functions, structs, enums, etc.
{
"id": "sym_0001",
"name": "UserController",
"type": "Class",
"file": "Controllers/UserController.cs",
"line": 8,
"visibility": "public",
"exported": true,
"parent": "MyApp.Controllers",
"language": "cs"
}
Symbol types: Class, Function, Method, Interface, Struct, Enum, Namespace, Property, Constructor, Module, Record, Delegate, TypeAlias, Constant, Trait, Impl, Macro, Typedef, Annotation.
Visibility: public, private, internal, protected.
imports
Three categories of dependency edges:
{
"file_imports": [{ "from": "Controller.cs", "to": "Service.cs", "statement": "using MyApp.Services" }],
"project_references": [{ "from_project": "Web.csproj", "to_project": "Core.csproj", "ref_type": "ProjectReference" }],
"package_references": [{ "project": "Web.csproj", "package": "Newtonsoft.Json", "version": "13.0.1" }]
}
Project and package references are extracted from .csproj/.vbproj files.
calls
Call graph edges with three-tier confidence scoring:
{
"from": "sym_0004",
"to": "sym_0015",
"confidence": 0.9,
"tier": "A",
"reason": "import-resolved",
"line": 17
}
| Tier | Confidence | Meaning |
|---|---|---|
| A | 0.9 | Callee found in an imported file |
| B | 0.85 | Callee found in the same file |
| C | 0.5 | Unique fuzzy match across the codebase |
| C | 0.3 | Ambiguous fuzzy match (multiple candidates) |
communities
Clusters of symbols that frequently call each other, detected via Louvain algorithm.
{
"id": "community_0",
"label": "Absence",
"members": ["sym_0004", "sym_0015", "sym_0016"],
"cohesion": 0.8,
"primary_language": "cs"
}
processes
Execution flows traced from entry points (controllers, handlers, main functions) via BFS through the call graph.
{
"id": "process_0",
"entry": "sym_0004",
"terminal": "sym_0016",
"steps": ["sym_0004", "sym_0015", "sym_0016"],
"type": "intra_community",
"total_confidence": 0.765
}
type is intra_community when all steps are in the same community, or cross_community when the flow spans multiple.
total_confidence is the product of all edge confidences along the path.
Tests
uv run pytest # 229 tests
uv run pytest -v # Verbose output
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
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 mycelium_map-0.1.1.tar.gz.
File metadata
- Download URL: mycelium_map-0.1.1.tar.gz
- Upload date:
- Size: 115.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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 |
b79788f72af19d8393cbf3d74b1c2c2e158027668f46049285f04e9bdf22d11e
|
|
| MD5 |
aaca61efb10fb2c54a28cbf9c2d18976
|
|
| BLAKE2b-256 |
67898458e7a56bd2398d6567c26ecf270307804bd0473d63d94762d4dda4a7a2
|
File details
Details for the file mycelium_map-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mycelium_map-0.1.1-py3-none-any.whl
- Upload date:
- Size: 55.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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 |
380fae9ec2afb6192247587c7f6e02315a57e569c4067d8d9fa157fc60b4a50f
|
|
| MD5 |
c72b2ff3a2336cdc71307f52ffaafb73
|
|
| BLAKE2b-256 |
a8f835ff9abf8457e8eceb891f154895531441f325410768fa2d95516bee2b82
|