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

๐Ÿงช 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.2.tar.gz (22.0 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.2-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deptangle-0.1.2.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deptangle-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4eb612a5ce129926618612451c2a25eb71324b5992e5eed4b2fd5ac287cff237
MD5 ca47e4ee5ad31e0855d47eba8c507a35
BLAKE2b-256 db152ed4ce21c29ae3a038d70a220094818351658491a4162c3d9a295c5f951a

See more details on using hashes here.

Provenance

The following attestation bundles were made for deptangle-0.1.2.tar.gz:

Publisher: publish.yml on Solanki-Prem/deptangle

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

File details

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

File metadata

  • Download URL: deptangle-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deptangle-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b17956aed61dcd389c79a45a457fe065d2d1042f4acc7a6f7443c4031803ded
MD5 a03848b9cab7b5155722fc8a46c1ee02
BLAKE2b-256 dc8381487b3f124815867930577c668b5af292d36fa300b7a8ef1aaf5c5f3cef

See more details on using hashes here.

Provenance

The following attestation bundles were made for deptangle-0.1.2-py3-none-any.whl:

Publisher: publish.yml on Solanki-Prem/deptangle

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