Mapping module imports in Python for easy refactoring

前端 未结 4 465
逝去的感伤
逝去的感伤 2021-02-07 10:40

I have a bunch of Python modules I want to clean up, reorganize and refactor (there\'s some duplicate code, some unused code ...), and I\'m wondering if there\'s a tool to make

4条回答
  •  离开以前
    2021-02-07 11:41

    Modulefinder may not work with Python 3.5*, but pydeps worked very well:

    Installation:

    sudo apt install python-pygraphviz
    pip install pydeps
    

    Then, in the directory where you want to map from,

    pydeps --max-bacon=0 .
    

    ..to create a map of maximum depth.

    *An issue in Python 3.5 but not 3.6 caused the problems with modulefinder, similar to this

提交回复
热议问题