Intelligent Python dependency tracking and requirements.txt generation
reqtracker automatically detects and manages Python dependencies in your projects using static analysis, dynamic tracking, or hybrid approaches. Unlike traditional tools like pip freeze, reqtracker focuses on generating accurate requirements.txt files based on actual project usage.
- 🔍 Smart Dependency Detection: Analyzes your code to find actually used packages
- ⚡ Multiple Analysis Modes: Static (AST), Dynamic (runtime), or Hybrid (both)
- 🎯 Accurate Package Mapping: Maps imports like
cv2toopencv-python - 📦 Flexible Output: Multiple version strategies and output formats
- 🛠️ Zero Configuration: Works out of the box with sensible defaults
- ⚙️ Highly Configurable: Customize analysis via config files or API
- 🚀 CLI & Library: Use as command-line tool or Python library
- 🧪 Well-Tested: 204 comprehensive tests with >95% coverage
Install reqtracker using pip:
pip install reqtracker# Analyze current directory and generate requirements.txt
reqtracker analyze
# Track dependencies in specific paths
reqtracker track ./src ./app
# Generate with exact versions
reqtracker generate --version-strategy exact
# Use static analysis only
reqtracker analyze --mode static --output deps.txtimport reqtracker
# Simple usage - analyze current directory
packages = reqtracker.track()
print(packages) # {"requests", "numpy", "pandas"}
# Generate requirements.txt
reqtracker.generate()
# Complete workflow
reqtracker.analyze() # Track dependencies and generate requirements.txtThe project includes comprehensive testing with 204 tests:
# Run all tests
pytest
# Run with coverage
pytest --cov=src/reqtracker --cov-report=html
# Run integration tests only
pytest tests/integration -v- Unit Tests: Core functionality testing
- Integration Tests: Real project scenarios
- Performance Tests: Benchmarking different project sizes
- Cross-Platform Tests: Compatibility across operating systems
- Getting Started - Overview and quick start guide
- API Documentation - Complete API reference for all modules
- Configuration Guide - All configuration options
- Examples - Real-world usage examples and tutorials
I welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.