A powerful command-line utility for identifying outdated Python packages
Compare installed versions with PyPI using intelligent SemVer analysis
$ python main.py check
Checking packages [####################################] 100%
Outdated Packages:
---------------------------------------------------------------
Package | Installed | Latest | Type | Compatible
---------------------------------------------------------------
pip | 25.0.1 | 25.2 | minor | β
setuptools | 80.7.1 | 80.9.0 | minor | β
jaraco.context | 5.3.0 | 6.0.1 | major | β
more-itertools | 10.3.0 | 10.7.0 | minor | β
---------------------------------------------------------------
Summary:
Total packages with updates: 14
Major updates: 2 (β οΈ breaking changes)
Minor updates: 12 (β
safe to update)
Feature | Description | Benefit |
---|---|---|
π¦ Smart Package Detection | Automatically scans installed packages or reads from requirements.txt | No manual package listing needed |
π PyPI Integration | Real-time version checking against Python Package Index | Always current version information |
π SemVer Compatibility | Intelligent semantic versioning analysis with breaking change detection | Safe upgrade recommendations |
π Multiple Output Formats | Table, JSON, and CSV export options | Perfect for any workflow |
β‘ Batch Processing | Efficient concurrent API calls with rate limiting | Fast processing of large package lists |
π§ͺ Pre-release Handling | Configurable inclusion of alpha, beta, and RC versions | Stay on the cutting edge |
π¨ Colorful CLI | Rich, colored terminal output with progress indicators | Beautiful and informative interface |
π§ Advanced Filtering | Filter by update type (major, minor, patch) | Focus on what matters most |
π CI/CD Ready | Export results for automated workflows | Perfect for continuous integration |
π Comprehensive Logging | Detailed logging with configurable levels | Debug and monitor with confidence |
- Python 3.7 or higher
- pip package manager
# Install required packages
pip install click>=8.0.0 colorlog>=6.0.0 packaging>=21.0.0 requests>=2.25.0 toml>=0.10.0 psutil>=7.0.0
# Additional dependencies for full functionality
pip install urllib3>=1.21.1 charset-normalizer>=2.0.0 idna>=2.5 certifi>=2017.4.17
# Clone or download the project files
git clone <repository-url>
cd python-dependency-reader
# Install dependencies
pip install click colorlog packaging requests toml psutil urllib3 charset-normalizer idna certifi
# Run the tool
python main.py --help
# Check all installed packages for updates
python main.py check
# Check packages from requirements.txt
python main.py check --requirements requirements.txt
# Get detailed information about a specific package
python main.py info requests
# Show current configuration
python main.py config-show
# Include pre-release versions in checks
python main.py check --include-prerelease
# Filter by update type (major, minor, patch)
python main.py check --filter-type major
# Export results to different formats
python main.py check --output json --export results.json
python main.py check --output csv --export outdated.csv
# Batch processing with custom settings
python main.py check --batch-size 5 --timeout 20
# Enable verbose logging
python main.py --verbose check
Checking packages [####################################] 100%
Outdated Packages:
---------------------------------------------------------------
Package | Installed | Latest | Type | Compatible
---------------------------------------------------------------
pip | 25.0.1 | 25.2 | minor | β
setuptools | 80.7.1 | 80.9.0 | minor | β
jaraco.context | 5.3.0 | 6.0.1 | major | β
more-itertools | 10.3.0 | 10.7.0 | minor | β
---------------------------------------------------------------
Summary:
Total packages with updates: 14
Major updates: 2
Minor updates: 12
Patch updates: 0
PDR supports configuration via TOML files and environment variables.
Create a .pdr.toml
file in your project root:
[pypi]
timeout = 30
batch_size = 10
rate_limit_delay = 0.1
[output]
default_format = "table"
colors_enabled = true
[version_checking]
include_prerelease = false
strict_semver = true
export PDR_PYPI_TIMEOUT=60
export PDR_PYPI_BATCH_SIZE=5
export PDR_INCLUDE_PRERELEASE=true
export PDR_LOG_LEVEL=DEBUG
Clean, colored table showing package updates with compatibility indicators.
python main.py check --output json --export results.json
{
"timestamp": "2024-01-15T10:30:00",
"total_packages": 14,
"packages": [
{
"package": "requests",
"installed": "2.28.0",
"latest": "2.31.0",
"update_type": "minor",
"compatible": true
}
],
"summary": {
"total_updates": 14,
"major_updates": 2,
"minor_updates": 12
}
}
python main.py check --output csv --export outdated.csv
Perfect for importing into spreadsheets or data analysis tools.
- Patch Updates (1.0.0 β 1.0.1): Bug fixes, always compatible β
- Minor Updates (1.0.0 β 1.1.0): New features, backward compatible β
- Major Updates (1.0.0 β 2.0.0): Breaking changes, review required
β οΈ
Control whether to include alpha, beta, and release candidate versions:
python main.py check --include-prerelease
Efficiently check multiple packages with configurable concurrent requests:
python main.py check --batch-size 10 --timeout 30
Built-in rate limiting respects PyPI API constraints while maximizing performance.
GitHub Actions
name: Dependency Check
on: [push, pull_request]
jobs:
check-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Check dependencies
run: |
pip install click colorlog packaging requests toml psutil
python main.py check --filter-type major
Pre-commit Hook
#!/bin/sh
# .git/hooks/pre-commit
python main.py check --filter-type major --timeout 10
# Check development dependencies
python main.py check --requirements dev-requirements.txt
# Check production only
python main.py check --requirements prod-requirements.txt
python-dependency-reader/
βββ assets/ # SVG icons and logos
βββ docs/ # Comprehensive documentation
βββ examples/ # Example files and usage scenarios
βββ src/ # Core application modules
β βββ cli.py # Command-line interface
β βββ pypi_client.py # PyPI API integration
β βββ version_comparator.py # SemVer analysis
β βββ package_manager.py # Package detection
β βββ output_formatter.py # Result formatting
β βββ config.py # Configuration management
β βββ utils.py # Utility functions
βββ main.py # Application entry point
βββ README.md # This file
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
git clone <repository-url>
cd python-dependency-reader
pip install -r requirements.txt
python main.py --help
This project is licensed under the MIT License - see the LICENSE file for details.
- Python packaging community for the
packaging
library - Click framework for excellent CLI tools
- PyPI for providing the package index API
- Contributors and testers
- Documentation: See the
docs/
directory - Examples: Check
examples/
for usage scenarios - Issues: Report bugs and feature requests on GitHub
- Configuration: Use
python main.py config-show
for current settings
Keep your Python packages up to date with confidence! πβ¨