CLI tool that reads requirements.txt/pyproject.toml/package.json and reports how far behind each dependency is from latest, grouped by severity (patch/minor/major). JSON or terminal table output.
Quick Start • Features • Examples • Contributing
DepDrift is a command‑line utility that scans Python and Node dependency files to determine how outdated each package is, categorizing the gap into patch, minor, or major version differences. It helps solo developers quickly assess dependency staleness without needing external services.
Example:
$ depdrift check --format table requirements.txt
+----------+------------+-----------+----------+
| Package | Current | Latest | Severity |
|----------|------------|-----------|----------|
| requests | 2.25.1 | 2.31.0 | minor |
| django | 4.0.0 | 4.2.0 | minor |
| numpy | 1.22.0 | 2.0.0 | major |
+----------+------------+-----------+----------+
Dependency staleness accumulates silently in projects, especially those maintained by solo developers. Existing tools such as Dependabot and Renovate require hosted infrastructure; there is no simple CLI that provides a local staleness report.
| Feature | Description |
|---|---|
| Multi‑format parsing | Reads requirements.txt, pyproject.toml, and package.json |
| Live version lookup | Queries PyPI and npm registries forlatest versions |
| Semantic severity grouping | Classifies drift as patch, minor, or major |
| Flexible output | Human‑readable table or machine‑friendly JSON |
| Auto‑detect | Finds a dependency file in the current directory if none is given |
| Graceful unknown‑package handling | Skips packages not present in registries |
| CI‑friendly JSON mode | Can be forced via DEPDRIFT_OUTPUT=json |
| Scriptable exit code | Returns non‑zero when any outdated dependency is found |
- Clone the repository:
git clone https://github.com/<your-user>/DepDrift.git - Install the package in editable mode:
cd DepDrift && pip install -e . - Run a basic check:
depdrift check
Example 1 – Table output for a Python project
Command:
depdrift check --format table requirements.txt
Output:
+----------+------------+-----------+----------+
| Package | Current | Latest | Severity |
|----------|------------|-----------|----------|
| requests | 2.25.1 | 2.31.0 | minor |
| django | 4.0.0 | 4.2.0 | minor |
| numpy | 1.22.0 | 2.0.0 | major |
+----------+------------+-----------+----------+
Example 2 – JSON output for a Node project
Command:
depdrift check --format json package.json
Output:
{
"lodash": {"current": "4.17.15", "latest": "4.17.21", "severity": "patch"},
"express": {"current": "4.17.1", "latest": "5.0.0", "severity": "major"},
"react": {"current": "17.0.2", "latest": "18.2.0", "severity": "major"}
}Example 3 – Auto‑detect and suppress unknown packages
Command:
depdrift check
Output (when a pyproject.toml is present):
+----------------+------------+-----------+----------+
| Package | Current | Latest | Severity |
|----------------|------------|-----------|----------|
| fastapi | 0.68.0 | 0.103.0 | minor |
| pydantic | 1.8.2 | 2.5.0 | major |
+----------------+------------+-----------+----------+
DepDrift/
├── depdrift/ # Source code (CLI, parsers, version logic, output)
│ ├── __init__.py
│ ├── __main__.py # Entry point
│ ├── main.py
│ ├── models.py
│ ├── output.py
│ ├── parsers.py
│ ├── utils.py
│ └── version.py
├── tests/ # Unit tests
│ ├── test_output.py
│ ├── test_parsers.py
│ └── test_version.py
├── assets/ # Infographic used in README
│ └── infographic.png
├── screenshots/ # Verification screenshots (not required for users)
├── .gitignore
├── init.sh # Setup script
└── README.md
| Technology | Purpose |
|---|---|
| Python 3.9+ | Core language |
| requests | HTTP client for PyPI and npm registries |
| packaging | Version parsing and comparison |
| toml | Parsing pyproject.toml files |
| json (std‑lib) | JSON output generation |
- Fork the repository.
- Create a feature branch (
git checkout -b feature/foo). - Make changes, add tests, and ensure the test suite passes.
- Submit a pull request for review.
MIT
Matthew Snow -- M2AI | @m2ai-portfolio
