You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generate graph for all .py in folder recursively #87
This is my first time using this library. Thank you for creating and maintaining. 🙏
Is there a way I recursively generate a graph for all python files within a folder and its' sub-directories?
(I imagine this is possible if I use the pacakge's low-level apis. I'm hoping there's a more straightforward method or flag I can use.)
You can work around this by getting your shell to list the desired files and pass them all to code2flow as arguments. I came up with these:
Powershell: code2flow (Get-ChildItem -Filter "*.py" -Recurse | Resolve-Path -Relative)
Bash: find . -name "*.py" -exec code2flow {} +
Or with a configurable depth limit:
Powershell: code2flow (Get-ChildItem -Filter "*.py" -Depth 1 | Resolve-Path -Relative)
Bash: find . -maxdepth 1 -name "*.py" -exec code2flow {} +
I've also found it useful to ignore top-level directories starting with . (ex. .venv):
Powershell: code2flow (Get-ChildItem -Exclude ".*" -Directory | Get-ChildItem -Filter "*.py" -Depth 1 | Resolve-Path -Relative)
Activity
jasonharitou commentedon Nov 4, 2023
I also have this question/feature request.
mirrorcoloured commentedon Jan 23, 2025
You can work around this by getting your shell to list the desired files and pass them all to code2flow as arguments. I came up with these:
Powershell:
code2flow (Get-ChildItem -Filter "*.py" -Recurse | Resolve-Path -Relative)Bash:
find . -name "*.py" -exec code2flow {} +Or with a configurable depth limit:
Powershell:
code2flow (Get-ChildItem -Filter "*.py" -Depth 1 | Resolve-Path -Relative)Bash:
find . -maxdepth 1 -name "*.py" -exec code2flow {} +I've also found it useful to ignore top-level directories starting with
.(ex..venv):Powershell:
code2flow (Get-ChildItem -Exclude ".*" -Directory | Get-ChildItem -Filter "*.py" -Depth 1 | Resolve-Path -Relative)