didn't quite understand what you're asking, but i guess you're looking for something like this
[root@localhost code]# cat mr_example.py
from mrjob.job import MRJob
class MRWordFrequencyCount(MRJob):
def mapper(self, _, line):
yield "chars", len(line)
yield "words", len(line.split())
yield "lines", 1
def reducer(self, key, values):
yield key, sum(values)
if __name__ == '__main__':
MRWordFrequencyCount.run()
[root@localhost code]# cat test_file
aaaa
dd dx csadsad
2321 dasdtokcmk
mii xsa
xaaaa
casd
[root@localhost code]# python mr_example.py test_file
...
"chars" 50
"lines" 6
"words" 10