Python Import List
View, filter, and navigate Python imports with ease!
A powerful VS Code extension that displays all Python imports in a clean, organized sidebar view with advanced filtering and navigation capabilities. Automatically categorizes imports by type and provides instant navigation to any import in your code.
✨ Features
📋 Organized Import View
- Automatic Import Detection: Displays all imports from your active Python file in a dedicated sidebar
- Smart Categorization: Automatically organizes imports into categories:
- Standard Library (📚): Built-in Python modules (os, sys, json, etc.)
- Third-Party (📦): External packages (numpy, pandas, flask, etc.)
- Local Modules (📄): Your project's local modules
- Relative Imports (🔗): Relative imports (from . or ..)
🔍 Powerful Filtering
- Inline Filter: Click the filter icon to show an input box directly in the sidebar
- Real-time Search: Type to instantly filter imports by name, type, or module
- Visual Feedback: Clear filter button to quickly reset your view
- Debounced Input: Smooth performance even with large import lists
🎨 Customizable Appearance
- Configurable Colors: Customize colors for each import type to match your preference
- Adjustable Font Size: Set the perfect font size (8-24px) for your import list
- VS Code Theme Integration: Automatically adapts to your VS Code theme
🎯 Quick Navigation
- Click to Jump: Click any import to instantly navigate to its line in the code
- Keyboard Friendly: Works seamlessly with keyboard navigation
- Multi-line Support: Correctly handles complex, multi-line import statements
🔄 Smart Updates
- Auto-Refresh: Automatically updates when you edit your Python files (configurable delay)
- Manual Refresh: Refresh button available when you need it
- Performance Optimized: Debounced updates prevent excessive parsing
📦 Installation
From VS Code Marketplace (Recommended)
- Open VS Code
- Press
Cmd+Shift+X
(macOS) or Ctrl+Shift+X
(Windows/Linux)
- Search for "Python Import List"
- Click Install
From VSIX File
- Download the
.vsix
file from the Releases page
- In VS Code, press
Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux)
- Type "Install from VSIX" and select the file
🚀 Usage
Viewing Imports
- Open any Python (
.py
) file
- Look for the Python Imports icon in the Activity Bar (left sidebar)
- Click it to open the Python Imports view
- All imports will be automatically listed and categorized
Filtering Imports
- Click the Filter button (🔍) in the toolbar
- An input box will appear below the toolbar
- Type to search (searches names, types, and modules)
- Results update in real-time as you type
- Click Clear Filter (✖️) to show all imports again
Navigating to Imports
- Simply click any import in the list to jump directly to its location in your code
Refreshing the List
- The list auto-refreshes when you edit the file
- Click the Refresh button (🔄) for manual refresh
⚙️ Configuration
Open VS Code Settings (Cmd+,
or Ctrl+,
) and search for "Python Import List":
{
// Auto-refresh on file changes
"pythonImportList.autoRefresh": true,
// Debounce delay in milliseconds
"pythonImportList.refreshDelay": 500,
// Group imports by type
"pythonImportList.groupByType": true,
// Font size for import items (8-24px)
"pythonImportList.fontSize": 13,
// Colors for different import types (hex or CSS colors)
"pythonImportList.colors.standard": "#C586C0", // Purple
"pythonImportList.colors.thirdParty": "#4EC9B0", // Teal
"pythonImportList.colors.local": "#4FC1FF", // Blue
"pythonImportList.colors.relative": "#C586C0" // Purple/Pink
}
🎨 Screenshots
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
)
- Commit your changes (
git commit -m 'Add some AmazingFeature'
)
- Push to the branch (
git push origin feature/AmazingFeature
)
- Open a Pull Request
📄 License
This extension is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Icons by Codicons
- Inspired by VS Code's built-in Outline view
- Built with ❤️ for the Python community
📧 Support
Enjoy coding with Python Import List! 🐍✨