Skip to main content

The lightning-fast, visual dependency detective that untangles and fixes your Python environments.

Project description

๐Ÿงถ deptangle

The lightning-fast, visual dependency detective that untangles and fixes your Python environments.

CI License: MIT Python 3.9+

deptangle is a modern CLI that diagnoses "dependency hell" for Python developers. It maps your dependency graph, scans for known CVEs via OSV, flags outdated and yanked packages, and uses a constraint solver to suggest the exact commands to fix conflicts โ€” powered by uv for speed.


โœจ Features

Feature Command
๐Ÿฉบ Environment diagnostics โ€” pinpoint the active interpreter & venv deptangle status
๐Ÿ—บ๏ธ Interactive dependency graph โ€” health-coloured HTML network deptangle map
๐Ÿ”’ Security scanning โ€” known CVEs via the OSV database deptangle check
โ™ป๏ธ Outdated / yanked detection โ€” via the PyPI JSON API deptangle check
๐Ÿ› ๏ธ Auto-fix suggestions โ€” constraint-solved upgrade/downgrade paths deptangle suggest
๐Ÿ“ฆ Lockfile support โ€” uv.lock, poetry.lock, Pipfile.lock all commands

๐Ÿš€ Install

# with uv (recommended)
uv tool install deptangle

# or with pip
pip install deptangle

Installs the deptangle command. (The import package is still pytangle internally; the PyPI distribution and CLI are named deptangle because pytangle was already taken on PyPI.)

๐Ÿงช Usage

# 1. Diagnose your environment
deptangle status

# 2. Visualise the dependency graph (writes an interactive HTML file)
deptangle map -o graph.html

# 3. Check for conflicts, outdated packages, and CVEs
deptangle check
deptangle check --only-issues          # show only problems
deptangle check --offline              # no network calls

# 4. Get actionable fix commands
deptangle suggest

# Work from a lockfile instead of the live environment
deptangle check --lockfile uv.lock

Color legend in the graph and tables: ๐ŸŸข healthy ยท ๐ŸŸก outdated ยท ๐ŸŸ  deprecated/yanked ยท ๐Ÿ”ด conflict ยท ๐Ÿ”ด vulnerable


๐Ÿ” Security by design

deptangle reads untrusted inputs (lockfiles, package metadata, remote APIs) and shells out to uv, so it is hardened from the ground up. See SECURITY.md.

  • No code execution โ€” lockfiles are parsed as data (tomllib/json); package code is never imported or eval'd.
  • Hardened subprocess โ€” shell=False, list-args only, resolved executables, timeouts, scrubbed environment.
  • SSRF-resistant networking โ€” HTTPS-only to an explicit host allowlist (pypi.org, api.osv.dev), redirects disabled, IP literals rejected, response size capped, timeouts enforced.
  • Injection-safe output โ€” package names/versions validated (PEP 508/440) and HTML-escaped before entering the graph; Pyvis JS served locally, not from a CDN.
  • deptangle never modifies your environment โ€” suggest only prints commands for you to review and run.

๐Ÿ—๏ธ Architecture

src/pytangle/
โ”œโ”€โ”€ cli.py          # Typer commands: status, map, check, suggest
โ”œโ”€โ”€ environment.py  # Phase 2 โ€” interpreter & venv diagnostics
โ”œโ”€โ”€ parser.py       # Phase 3 โ€” dependency graph + lockfile parsing
โ”œโ”€โ”€ visualizer.py   # Phase 3/4 โ€” Pyvis interactive HTML graph
โ”œโ”€โ”€ checker.py      # Phase 4 โ€” PyPI health (outdated/yanked/deprecated)
โ”œโ”€โ”€ security.py     # Phase 4 โ€” OSV vulnerability scanning
โ”œโ”€โ”€ resolver.py     # Phase 5 โ€” constraint-solving auto-fix engine
โ”œโ”€โ”€ report.py       # Rich table rendering
โ”œโ”€โ”€ models.py       # typed data models
โ””โ”€โ”€ _safety.py      # ๐Ÿ” centralised security primitives

๐Ÿง‘โ€๐Ÿ’ป Development

git clone https://github.com/Solanki-Prem/deptangle
cd deptangle
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"

ruff check src tests       # lint
mypy src                   # type check
pytest --cov=pytangle      # tests

๐Ÿ—บ๏ธ Roadmap

  • deptangle fix --apply โ€” execute suggested fixes automatically (with confirmation)
  • A GitHub Action that fails CI when a new CVE is introduced

๐Ÿ“„ License

MIT ยฉ Prem Solanki

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

deptangle-0.1.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

deptangle-0.1.1-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file deptangle-0.1.1.tar.gz.

File metadata

  • Download URL: deptangle-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for deptangle-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bc87c8a2e8d785e7979d0098bd7406eb19444d93741f96df23917b991da645ab
MD5 2ac1265e39f10b85bab902a5b7096a3d
BLAKE2b-256 84a73fdaaca725499635affe1592f68e213c93903f7458be964473890a53d5af

See more details on using hashes here.

File details

Details for the file deptangle-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: deptangle-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for deptangle-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ffd86230fd1c8e9f9053b3d92e19dc5ad087b40b6a4a30631bf92d5a799feb90
MD5 84304914ffff68bcf3fc8d7addf2f02e
BLAKE2b-256 4c7ff4c4c1555ba3cd67e0ca2f63077524136719cdd04b6880a8c4f162cc50e2

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