codingfix-from-imports

star 142

Replace "from X import Y" style imports with "import X" and update usages throughout a file

causify-ai By causify-ai schedule Updated 2/28/2026

description: Replace "from X import Y" style imports with "import X" and update usages throughout a file model: haiku

  • Replace any Python statement like from X import Y with the form import X and then replace the uses of Y with X.Y

  • For aliased imports from X import Y as Z, convert to import X and replace all uses of Z with X.Y

  • For nested module imports from X.Y import Z, convert to import X.Y and replace all uses of Z with X.Y.Z

  • The only ones that can stay as from X import Y are:

    from __future__ import annotations
    from typing import Any, Dict, List, Optional, Tuple, Union, ...  (any typing name)
    from IPython.display import display
    from pathlib import Path
    
  • Do not use

    # Re-export get_chat_model for backward compatibility.
    get_chat_model = langchain_API_utils.get_chat_model
    

    but replace all the callers

Install via CLI
npx skills add https://github.com/causify-ai/helpers --skill codingfix-from-imports
Repository Details
star Stars 142
call_split Forks 136
navigation Branch main
article Path SKILL.md
More from Creator