Coding.fix bloated imports

From gpsaggese/helpers · View interactive version

Coding.fix bloated imports is an AI agent skill from the GitHub repository gpsaggese/helpers. Fix Python imports of large packages needed only for few functions in a module

How to use this skill

Skill file

are large to import (e.g., ipython, pandas) and needed in only a few functions

<PACKAGES>

```python

def make_slider() -> "ipywidgets.IntSlider":

import ipywidgets

...

```

into

```python

from typing import TYPE_CHECKING

if TYPE_CHECKING:

import ipywidgets

def make_slider() -> "ipywidgets.IntSlider":

import ipywidgets

...

```

```python

"Tuple[Union[ipywidgets.FloatSlider, ipywidgets.IntSlider], ipywidgets.HBox]"

```

```python

Tuple[Union["ipywidgets.FloatSlider", "ipywidgets.IntSlider"], "ipywidgets.HBox"]

```

Verification

functions that use it

expressions

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.