Generate graph for all .py in folder recursively · Issue #87 · scottrogowski/code2flow · GitHub
Skip to content

Generate graph for all .py in folder recursively #87

Open

Description

@shruti222patel

Hi,

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.)

Activity

  1. jasonharitou commented on Nov 4, 2023

    @jasonharitou

    I also have this question/feature request.

  2. mirrorcoloured commented on Jan 23, 2025

    @mirrorcoloured

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions