A python3 interface with MediaWiki's API
By en:User:Legoktm. Released under the terms of the MIT License.
api.php
import mw
enwp = mw.Wiki('http://en.wikipedia.org/w/api.php')
enwp.login('username','password')
enwp.request({'action':'query'}) #etc...