remove_import_name
Removes a name from a multi-name import statement in Python or JS/TS. Automatically deletes the whole import if it's the last name, unless a default import remains.
Instructions
Remove a name from a named-import statement.
Python (.py):
from <module> import a, b, cJS/TS:
import { a, b, c } from "<module>"
If the name removed is the only remaining one AND there are no other
bindings (default / namespace) in the same statement, the entire import
line is removed. Raises an error if removing the last name would leave
an invalid import Default, {} from "mod" fragment.
Use this when: You want to remove a single name from a multi-name import.
Don't use this when: You want to remove the entire import line -> use
remove_import.
Example (Python): module="typing" name="List" Example (TS): module="./utils" name="bar"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| module | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |