remove_import_name
Remove a specific name from a named import statement, such as removing 'List' from 'from typing import List, Dict'. Automatically removes the entire import if it is the only name.
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 |
|---|---|---|---|
| file_path | Yes | ||
| module | Yes | ||
| name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |