Skip to content

Support multiple -o/--outfile flags in a single invocation #422

@ryan-crabbe

Description

@ryan-crabbe

It would be useful to generate multiple output formats in one run

e.g.: pyinstrument -o output.txt -o output.html script.py

Use case: I like to get the HTML view for visual inspection and the text view to pass to an LLM, since it's fewer tokens. Currently I work around this by outputting a .pyisession file and then rendering it to HTML and text separately its a small step

Behavior:

  • Each outfile infers its renderer from the file extension (unless -r is explicitly set, which applies to all)
  • No -o or single -o behavior is unchanged
  • Unrecognized extensions without -r produce a clear error

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