core

Core codes for carport.


source

path2module

 path2module (path:str, root:str='.')

source

module2path

 module2path (mod_name:str, root:str='.')

source

imps_from_file

 imps_from_file (path:pathlib.Path, root:str='.')

source

get_imps

 get_imps (root:str='.', project:str='', agg_external:bool=True,
           agg_internal:bool=True)
Type Default Details
root str . directory where to look for import structure
project str name of concerned project module
agg_external bool True whether to aggregate external imports by subsuming descendant modules
agg_internal bool True whether to aggregate internal imports by subsuming non-modular leaves

source

ImportGraph

 ImportGraph (root:str='.', project:str='', **kwargs)

Initialize self. See help(type(self)) for accurate signature.


source

ImportGraph.to_nx

 ImportGraph.to_nx (ignore_nodes=[], **kw)

source

ImportGraph.to_dot

 ImportGraph.to_dot (path=None, **kw)

See networkx drawing module.


source

ImportGraph.to_d2

 ImportGraph.to_d2 (ignore_nodes=[], **kw)

Alternatives: py_d2 may be a better way to do this.


source

ImportGraph.draw_dot

 ImportGraph.draw_dot (**kw)

source

ImportGraph.draw_d2

 ImportGraph.draw_d2 (app='kroki', **kw)