Lightweight Swift file-level dependency mapper
Project description
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-filesguard 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 NMax rows per focus section (default: 20).--max-files NAbort if more than N Swift files are detected (0 disables).--json PATHWrite the JSON report to PATH.--graph-format {mermaid,dot,cytoscape}Choose graph export format.--graph-output PATHWrite graph output to PATH (stdout if omitted).--include-viewerWhen using--graph-format cytoscapewith--graph-output, also dropcyto_viewer.htmlbeside the JSON so you can open it directly.--versionShow 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-filedefines/references.
Development
- Requires Python 3.9+.
- Install/iterate locally:
uvx --from . swift-deps-map --helporpython -m swift_deps_map --help. - Package data includes
cyto_viewer.htmlfor Cytoscape visualization if you want an offline viewer.
License
Apache-2.0. See LICENSE.
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 swift_deps_map-0.1.0.tar.gz.
File metadata
- Download URL: swift_deps_map-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63dcbc250297d2520603acbd0235b9bcdaf40aa1b79b280133e0977e58994546
|
|
| MD5 |
1630b700953c5bfe2e736c8059f5160e
|
|
| BLAKE2b-256 |
b3448fe2260b69a88f7fdc776fb33dcbdb04d281a330c8e65ff7101b0518d97b
|
File details
Details for the file swift_deps_map-0.1.0-py3-none-any.whl.
File metadata
- Download URL: swift_deps_map-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
310265ec7991d88bd18567cf6ec52c79a2c45493904f06b3986c626d9bc13aa6
|
|
| MD5 |
409e11a8330d203bd573c0ab99693e1a
|
|
| BLAKE2b-256 |
f2cdf5af1f420f73b833d4ae59bcf980896cb7666ca6bacc958c0f5fab527b9f
|