Does anyone know of any tools/scripts that would score a MSA in a sliding window manner?

I want to get the average identity across the length of an operon MSA, so I'm looking for something that gives me back a measure of conservation that I can graph.

I found some old threads on BioStars, but a lot of the linked packages either aren't exactly what I'm looking for, or the links etc are just defunct.

If I have to write this myself (probably with python), does anyone have any thoughts on appropriate ways to score each window?
Wrote my own in the end. Uses some bits of code I found online, but a bit more performant.

https://gist.github.com/jrjhealey/130d4efc6260dd76821edc8a41d45b6a