Skip to content

Add python3 / python rewrite support #928

@sebagavilan

Description

@sebagavilan

Problem

rtk discover shows ~691 python3 heredoc commands and ~289 python3 script invocations not being rewritten. rtk rewrite has no rule for python3 or python.

Patterns to support

Pattern Example Count (30d)
python3 << 'PYEOF' Inline heredoc scripts ~691
python3 script.py Script execution ~289
python -m <module> Module execution (unittest, py_compile) ~83

Reproduction

$ rtk rewrite "python3 << 'PYEOF'"
# exit 1, no output — no rewrite rule

$ rtk rewrite "python3 scripts/my_script.py"
# exit 1, no output

$ rtk rewrite "python -m unittest discover -s ."
# exit 1, no output

Environment

  • rtk 0.30.1
  • macOS (Darwin 23.5.0)

Impact

Python heredoc scripts often produce large DataFrames/dicts as output — high token savings potential. Combined ~1,063 commands over 30 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions