-
Replace any Python statement like
from X import Ywith the formimport Xand then replace the uses ofYwithX.Y -
For aliased imports
from X import Y as Z, convert toimport Xand replace all uses ofZwithX.Y -
For nested module imports
from X.Y import Z, convert toimport X.Yand replace all uses ofZwithX.Y.Z -
The only ones that can stay as
from X import Yare:from __future__ import annotations from typing import Any, Dict, List, Optional, Tuple, Union, ... (any typing name) from IPython.display import display
↓ Quality Score
Agent Capability Analysis
The coding.fix_from_imports MCP Server by causify-ai is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion.
Ideal Agent Persona
Ideal for Python Code Analysis Agents specializing in import optimization and PEP 8 compliance.
Core Value
Automates conversion of Python 'from X import Y' statements to explicit 'import X' form, replacing usage with qualified X.Y references while preserving __future__ and typing imports for enhanced code maintainability and namespace clarity.
↓ Capabilities Granted for coding.fix_from_imports MCP Server
! Prerequisites & Limits
- Python-specific syntax transformation only
- Preserves __future__ and typing imports unchanged
- Requires accurate symbol usage tracking
- Limited to standard Python import patterns