core
Core codes for carport.
path2module
path2module (path:str, root:str='.')
module2path
module2path (mod_name:str, root:str='.')
imps_from_file
imps_from_file (path:pathlib.Path, root:str='.')
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 |
ImportGraph
ImportGraph (root:str='.', project:str='', **kwargs)
Initialize self. See help(type(self)) for accurate signature.
ImportGraph.to_nx
ImportGraph.to_nx (ignore_nodes=[], **kw)
ImportGraph.to_dot
ImportGraph.to_dot (path=None, **kw)
See networkx drawing module.
ImportGraph.to_d2
ImportGraph.to_d2 (ignore_nodes=[], **kw)
Alternatives: py_d2
may be a better way to do this.
ImportGraph.draw_dot
ImportGraph.draw_dot (**kw)
ImportGraph.draw_d2
ImportGraph.draw_d2 (app='kroki', **kw)