import pywikibot
from pywikibot import i18n, pagegenerators, Bot

site = pywikibot.Site('id', 'wikipedia')
site.login()
import mwapi
help(mwapi)
Help on package mwapi:

NAME
    mwapi

DESCRIPTION
    This library provides a set of basic utilities for interacting with MediaWiki's
    "action" API -- usually available at /w/api.php.  The most salient feature of
    this library is the `Session` class that provides a
    connection session that sustains a logged-in user status and provides
    convenience functions for calling the MediaWiki API -- for example,
    `get()`, `post()`, and `login()`.
    
    :Authors:
        * YuviPanda https://github.com/yuvipanda
        * Aaron Halfaker https://github.com/halfak
    
    :License: MIT

PACKAGE CONTENTS
    about
    cli
    errors
    session

DATA
    __all__ = [<class 'mwapi.session.Session'>, <class 'mwapi.session.Sess...
    __author_email__ = 'aaron.halfaker@gmail.com'
    __description__ = 'Simple wrapper for the Mediawiki API'
    __license__ = 'MIT'
    __url__ = 'https://github.com/mediawiki-utilities/python-mwapi'

VERSION
    0.5.1

AUTHOR
    Aaron Halfaker

FILE
    /srv/paws/lib/python3.6/site-packages/mwapi/__init__.py