pip install mwoauth
This library provide a simple means to performing an OAuth handshake with a MediaWiki installation with the OAuth Extension installed.