python-textops provides many text operations at string level, list level or whole text level.
These operations can be chained with a ‘dotted’ or ‘piped’ notation.
Chained operations are stored into a single lazy object, they will be executed only when an input text will be provided.
Here is a simple example to count number of mails received from email@example.com since May 25th:
>>> '/var/log/mail.log' | cat().grep('firstname.lastname@example.org').since('May 25').lcount() 37
python-textops is used into some other projects like python-nagios-helpers