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.

Powered by a Rust engine with tree-sitter parsing, exposed to Python via PyO3.

Install

pip install mycelium-map

Pre-built binary wheels are available for Linux (x86_64, aarch64), macOS (x86_64, aarch64), and Windows (x86_64). Source builds require a Rust toolchain.

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

Python API

from mycelium import analyze

result = analyze("path/to/repo")
print(result["stats"])

Supported Languages

Language Extensions
C# .cs
VB.NET .vb
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": "1.0.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.

Development

# Rust tests
cargo test --workspace

# Build Python bindings locally
pip install maturin
maturin develop --release

# Run binding tests
pytest tests/test_bindings.py -v

# Rust CLI (alternative to Python CLI)
cargo run -p mycelium-cli -- analyze <path>

Releasing

Releases are automated via GitHub Actions. Push a semver tag to trigger a release:

git tag v1.0.0
git push origin v1.0.0

This will:

  1. Build binary wheels for Linux, macOS, and Windows
  2. Build a source distribution
  3. Publish all to PyPI

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.3.3.tar.gz (582.4 kB view details)

Uploaded Source

Built Distributions

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

mycelium_map-0.3.3-cp312-cp312-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.12Windows x86-64

mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

mycelium_map-0.3.3-cp312-cp312-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mycelium_map-0.3.3-cp312-cp312-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: mycelium_map-0.3.3.tar.gz
  • Upload date:
  • Size: 582.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mycelium_map-0.3.3.tar.gz
Algorithm Hash digest
SHA256 13a620a869314824d1db5bf9f5f387d16425b285b0143300695aadd1e650f45e
MD5 ce9cfc07ec07ad727bed441454e99b9a
BLAKE2b-256 f455e33a698a91691668a8246bb0ccb5d6b7a07ae13bb6f1ba49f3af8df6e947

See more details on using hashes here.

Provenance

The following attestation bundles were made for mycelium_map-0.3.3.tar.gz:

Publisher: release.yml on ScottRBK/mycelium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mycelium_map-0.3.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for mycelium_map-0.3.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 77ff32b85b7da9a944fe466f792f5d452dde502555135ab4b4c6532a1c2f125b
MD5 d632a183b675b1bc9c76de408effee3a
BLAKE2b-256 5904e512ab392b77ed9404944167ea036f3717c6b6886a9b28726b0f6056a93f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mycelium_map-0.3.3-cp312-cp312-win_amd64.whl:

Publisher: release.yml on ScottRBK/mycelium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a7bfa3469703c042fc171c5df0b1b6161bab1fe27dccb9048a283d7994afe97
MD5 07164a846bb25f8ce8bc57e23fc44332
BLAKE2b-256 6689dd17dca54ade7435ca2a575227f99b8455b2350e67f77a9b6f090c4cb94f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ScottRBK/mycelium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 975fbb73e7b452d1c53b7d026a1e16fdcc73040c5b9e1ba9b6c7e26bee825499
MD5 a76b5909e78c1c9c98ec5e200ec5ff2d
BLAKE2b-256 143caa92d469e309b7696fe262ec97118381299873c5bd7b1f3c9725baf95079

See more details on using hashes here.

Provenance

The following attestation bundles were made for mycelium_map-0.3.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on ScottRBK/mycelium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mycelium_map-0.3.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mycelium_map-0.3.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b700827c47985c7a0f08a2840ea14db7f440e536cc05c463e1387274906e734
MD5 3f3a370622fbd73725d66e52df681172
BLAKE2b-256 5c98c2ddd4dcec1ec6f40f73937433debebbb2b8df03ecbd5171ab91750163bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mycelium_map-0.3.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on ScottRBK/mycelium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mycelium_map-0.3.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mycelium_map-0.3.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a27bf85cf1ab852b701eed01f6ca5823586e34647e22b5f5209faaae1e10c412
MD5 692679156d00f453ea3de778a5d9ea2d
BLAKE2b-256 f023908a00b2eb9255557bbebbbcdcbd00a2d042fdcf62a6776fde6f34ba3f8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mycelium_map-0.3.3-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: release.yml on ScottRBK/mycelium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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