I’m looking for a way to generate a single Markdown (.md) file that includes all the file names, function definitions, and docstrings from my Python files. Ideally, this should traverse a directory recursively while respecting the .gitignore rules.

Does anyone know of a package that accomplishes this?

  • matthewdeanmartin@programming.dev
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    2 months ago

    There are A LOT of these. I have had good experience with https://pypi.org/project/git2md

    Says “Support for .gitignore, .globalignore and .mdignore for local projects: Automatically excludes files/directories specified in .gitignore, .globalignore or .mdignore.”

    If you don’t find what you like, I’ve also found it easy to ask LLMs to just write a tool customized to my use case, usually when I need to somehow condense the code base to make it fit in the context.