The lightning-fast, visual dependency detective that untangles and fixes your Python environments.
Project description
🧶 PyTangle
The lightning-fast, visual dependency detective that untangles and fixes your Python environments.
PyTangle 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 | pytangle status |
| 🗺️ | Interactive dependency graph — health-coloured HTML network | pytangle map |
| 🔒 | Security scanning — known CVEs via the OSV database | pytangle check |
| ♻️ | Outdated / yanked detection — via the PyPI JSON API | pytangle check |
| 🛠️ | Auto-fix suggestions — constraint-solved upgrade/downgrade paths | pytangle 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
pytanglecommand. (The PyPI distribution is nameddeptanglebecausepytanglewas already taken.)
🧪 Usage
# 1. Diagnose your environment
pytangle status
# 2. Visualise the dependency graph (writes an interactive HTML file)
pytangle map -o graph.html
# 3. Check for conflicts, outdated packages, and CVEs
pytangle check
pytangle check --only-issues # show only problems
pytangle check --offline # no network calls
# 4. Get actionable fix commands
pytangle suggest
# Work from a lockfile instead of the live environment
pytangle check --lockfile uv.lock
Color legend in the graph and tables: 🟢 healthy · 🟡 outdated · 🟠 deprecated/yanked · 🔴 conflict · 🔴 vulnerable
🔐 Security by design
PyTangle 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 oreval'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.
- PyTangle never modifies your environment —
suggestonly 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/pytangle
cd pytangle
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
pytangle 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
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 deptangle-0.1.0.tar.gz.
File metadata
- Download URL: deptangle-0.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b51987b187007dafd78ceecf91803b9c49b3bf3f0c9b3be1b2adb6d0d7fa6b98
|
|
| MD5 |
407042a8622bb9ab3b80bb2092f1cc6f
|
|
| BLAKE2b-256 |
61765ef619fb50408d6eedfb99f3d292472bc008f17fc4e7f5fca89902d08526
|
File details
Details for the file deptangle-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deptangle-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
885f2b84d0406735caf2c3542f9def4abe88ae9925c378c9ee00afaead988c50
|
|
| MD5 |
f9f598a769fa0ed1b73437d26f5b98a5
|
|
| BLAKE2b-256 |
0e8a2631205913d86329db3e9ba513601ae08e1a34026ccecc034f503aae57e5
|