Skip to main content

swift-deps-map

Lightweight Swift file-level dependency mapper that scans a source tree for symbol definitions/references and reports cross-file edges. Generates human-readable summaries plus optional graph/JSON exports for visualization.

Features

  • Default root is the current working directory for drop-in use on any Swift repo.
  • Supports focus prefixes for zooming into specific folders.
  • Exports graphs in Mermaid, Graphviz DOT, or Cytoscape JSON.
  • Optional JSON report with symbols and edges for further processing.
  • --max-files guard to avoid runaway scans on very large projects.
  • Proper exit codes with errors sent to stderr for automation friendliness.

Quick start

From PyPI (after publishing):

uvx swift-deps-map --help
uvx swift-deps-map --root /path/to/src --graph-format mermaid --graph-output deps.mmd

Local, without publishing (run at repo root):

uvx --from . swift-deps-map --root . --graph-format cytoscape --graph-output deps.cyto.json

You can also call the module directly:

python -m swift_deps_map --help

CLI options

  • --root PATH (default: .) Root directory to scan.
  • --focus PREFIX... Limit printed focus sections to matching relative paths.
  • --limit N Max rows per focus section (default: 20).
  • --max-files N Abort if more than N Swift files are detected (0 disables).
  • --json PATH Write the JSON report to PATH.
  • --graph-format {mermaid,dot,cytoscape} Choose graph export format.
  • --graph-output PATH Write graph output to PATH (stdout if omitted).
  • --include-viewer When using --graph-format cytoscape with --graph-output, also drop cyto_viewer.html beside the JSON so you can open it directly.
  • --version Show the CLI version.

Outputs

  • Console summary: Total Swift files, unique symbols, duplicate symbol hints, and feature-level edges.
  • Graph exports: Mermaid/DOT snippets or Cytoscape JSON for visual viewers.
  • JSON report: Includes root, focus, dependencies, and per-file defines/references.

Development

  • Requires Python 3.9+.
  • Install/iterate locally: uvx --from . swift-deps-map --help or python -m swift_deps_map --help.
  • Package data includes cyto_viewer.html for Cytoscape visualization if you want an offline viewer.

License

Apache-2.0. See LICENSE.

Release files for swift-deps-map 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swift-deps-map 0.1.0
File Size Uploaded
swift_deps_map-0.1.0.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swift-deps-map 0.1.0
File Interpreter ABI Platform
swift_deps_map-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.3 kB

Release files / swift_deps_map-0.1.0.tar.gz

Download URL swift_deps_map-0.1.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
63dcbc250297d2520603acbd0235b9bcdaf40aa1b79b280133e0977e58994546
BLAKE2b-256 checksum
How to use checksums
b3448fe2260b69a88f7fdc776fb33dcbdb04d281a330c8e65ff7101b0518d97b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / swift_deps_map-0.1.0-py3-none-any.whl

Download URL swift_deps_map-0.1.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
310265ec7991d88bd18567cf6ec52c79a2c45493904f06b3986c626d9bc13aa6
BLAKE2b-256 checksum
How to use checksums
f2cdf5af1f420f73b833d4ae59bcf980896cb7666ca6bacc958c0f5fab527b9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page