One way to do it is to export the article history, and then process the revisions using a local tool like
git blame. This could be done using a script.
To export the article history, use
To generate the blame, first add the revisions to a temporary git repository (shown in Python 3):
with tempfile.TemporaryDirectory() as repo:
Then download the exported history XML, parse it with something like
lxml.etree, and loop over the revisions (xpath
//revision). For each revision, write the text to a file (say
article.wiki), read the author, and run
subprocess.check_call(['git', 'commit', '-a', '-m', 'blah', '--author=' + str(author)])
After all revisions are added to the repo, run
git blame article.wiki to see the author of each line.
Special:Export might restrict the number of revisions exported, so in pages with long history you might have to fetch the XML multiple times.