Package Scout README
Package Scout is a powerful VS Code extension that automates the creation and maintenance of your Python project's requirements.txt file. It intelligently scans your code for imports, filters out standard libraries, and generates a clean, comprehensive list of dependencies, so you can focus on coding.
Say goodbye to manually managing your requirements.txt and install all required packages with pip install -r requirements.txt
!
Features
Package Scout is packed with features designed to make Python dependency management seamless and efficient.
1. Autoamtic Creation of requirements.txt
Simply save any Python file (Ctrl+S)
, and Package Scout will automatically analyze your project's dependencies and update your requirements.txt
file.
Tip: This feature can be easily toggled on or off directly from the status bar.
2. Analysis of Entire Project Directory
Instead of just looking at one file, Package Scout scans your entire workspace to build a complete list of all dependencies used across your project. It's smart enough to ignore virtual environments, .git
folders, and other excluded directories.
3. Intelligent Import Analysis
The extension uses comprehensive patterns to detect imports in various forms, including:
- Standard imports (
import pandas
)
- 'From' imports (
from matplotlib import pyplot
)
- Aliased imports (
import numpy as np
)
- Complex multi-line imports
4. Intelligent Packet Matching
Package Scout knows that when you import bs4
, the package you need is beautifulsoup4
. It comes with a built-in mapping for common packages whose import names differ from their PyPI package names.
5. Intuitive Status Bar
Quickly see if auto-generation is active or disabled. The status bar item also provides a handy tooltip with performance stats and acts as a one-click toggle.
6. On Demand Commands
Prefer manual control? Use the Command Palette (Ctrl+Shift+P
) to trigger analysis for the current file or the entire project whenever you need it.
Extension Settings
Package Scout is highly configurable. You can adjust its behavior in your VS Code settings:
- Enable/disable automatic generation on file save.
analyzeEntireProject
Property, If true, scans the entire project on save. If false, only scans the saved file.
- Show notifications when
requirements.txt
is updated.
- The name of the requirements file to generate. (Default:
requirements.txt
)
Known Issues
- Dynamic Imports: The extension uses static analysis and may not detect dependencies imported dynamically using methods like
__import__()
or importlib
.
- Environment Dependency: Version detection relies on the pip command available in your terminal's path. It may not reflect the versions in a specific virtual environment if it's not activated in the terminal VS Code uses.
Release Notes
1.0.0
Initial release of Package Scout!
- Automatic requirements.txt generation on file save.
- Manual generation commands for single files or the entire project.
- Intelligent import parsing, including multi-line statements.
- Smart mapping from import names to PyPI package names.
- Filtering of Python's built-in standard library modules.
- Optional package version pinning via pip.
- Configurable settings for tailored behavior.
- Helpful status bar indicator for quick toggling and stats.