Skip to main content

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

uv sync

Usage

mycelium analyze <path>                          # Analyse a repo
mycelium analyze <path> -o output.json           # Custom output path
mycelium analyze <path> --verbose                # Show phase timing breakdown
mycelium analyze <path> --quiet                  # No terminal output
mycelium analyze <path> -l cs,ts                 # Only analyse C# and TypeScript
mycelium analyze <path> --exclude vendor,legacy  # Skip directories
mycelium analyze <path> --resolution 1.5         # Louvain resolution (higher = more communities)
mycelium analyze <path> --max-processes 50       # Limit execution flows
mycelium 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

mycelium_map-0.1.0.tar.gz (120.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mycelium_map-0.1.0-py3-none-any.whl (55.7 kB view details)

Uploaded Python 3

File details

Details for the file mycelium_map-0.1.0.tar.gz.

File metadata

  • Download URL: mycelium_map-0.1.0.tar.gz
  • Upload date:
  • Size: 120.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

Hashes for mycelium_map-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6cb945bc84f511f2901f6e1f7f693a75248a0f882f26e989efd9f72d07a1f598
MD5 9a677fc238e48345d4548fa64c2981b6
BLAKE2b-256 f21a70c8ceccbf910d8a5bf883ed1aa7cd573ab4b119f28293020a4a2711815e

See more details on using hashes here.

File details

Details for the file mycelium_map-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mycelium_map-0.1.0-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

Hashes for mycelium_map-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48daead4fdd7657cf8ab0b904cb09a31b2a53a1e6bbdcfe76956a502ddde783e
MD5 c51c97daf8cc04d8aa3ab355ce8e8dc0
BLAKE2b-256 ecf0d9f97bc93adf74d28d923fe35d8985b94ebdd1061b7e2ed55569accad942

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page