Pytext is a very flexible and open text editor written in Python.