A VS Code extension that provides rich hover documentation for Python code by dynamically fetching content from the official Python documentation at runtime.
Features
Runtime Documentation Resolution: Fetches documentation from docs.python.org based on detected Python version
Intelligent Symbol Detection: Recognizes builtins, stdlib modules, exceptions, keywords, decorators, and methods
Anchor Preservation: Maintains exact documentation anchors for seamless navigation
Smart Caching: Respects ETag/Last-Modified headers with configurable cache TTL
Version Detection: Automatically detects Python version from project files or Python extension
Configurable: Customizable documentation version, snippet length, and cache behavior
Supported Python Elements
Built-in functions: len(), print(), str(), etc.
Built-in types and their methods: str.split(), list.append(), etc.
Standard library modules: os, sys, json, etc.
Exceptions: ValueError, TypeError, etc.
Keywords: if, for, while, etc.
Decorators: @property, @staticmethod, etc.
Configuration
{
"pythonHover.docsVersion": "auto", // Python version to use for docs
"pythonHover.maxSnippetLines": 12, // Max lines in hover snippets
"pythonHover.cacheTTL.inventoryDays": 7, // Days to cache inventory files
"pythonHover.cacheTTL.snippetHours": 48, // Hours to cache doc snippets
"pythonHover.enableKeywordDocs": true, // Enable keyword documentation
"pythonHover.telemetry": false // Telemetry (disabled by default)
}
Version Detection
The extension detects the appropriate Python version in this order:
Active interpreter from the Python extension (if available)