I couldn't find good Python libs to do this so ended up writing it myself.
Show HN: Diff filtering, text mapping, and windowed transforms for LLM apps
github.com