{"id":45501,"library":"mwclient","title":"mwclient","description":"A lightweight, Pythonic client for the MediaWiki API. Version 0.11.0. Active development, irregular releases.","status":"active","version":"0.11.0","language":"python","source_language":"en","source_url":"https://github.com/mwclient/mwclient","tags":["mediawiki","wiki","api","client"],"install":[{"cmd":"pip install mwclient","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for HTTP requests.","package":"requests","optional":false},{"reason":"Used for Python 2/3 compatibility (deprecated in newer versions).","package":"six","optional":false}],"imports":[{"note":"Top-level import is mwclient.Site; there is no mwclient.client submodule.","wrong":"from mwclient import client; site = client.Site(...)","symbol":"Site","correct":"import mwclient; site = mwclient.Site('en.wikipedia.org')"},{"note":"Page is exposed at the mwclient package level, not from mwclient.page.","wrong":"from mwclient.page import Page","symbol":"Page","correct":"from mwclient import Page"}],"quickstart":{"code":"import mwclient\n\nsite = mwclient.Site('en.wikipedia.org')\npage = site.pages['Python (programming language)']\nprint(page.text[:200])","lang":"python","description":"Connect to Wikipedia and fetch page text."},"warnings":[{"fix":"Update credentials format: `site = mwclient.Site('en.wikipedia.org', clients_useragent=('MyBot',))`","message":"In v0.11.0, the `Site` constructor changed: `site = mwclient.Site('en.wikipedia.org')` works, but authenticating requires passing `(('username', 'password'),)` as a tuple inside a list for `clients_useragent`. Older code may break.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"After creating a Site object, call `site.login(username, password)`.","message":"mwclient does not automatically handle login. You must explicitly call `site.login(username, password)` before editing. Many new users expect automatic authentication.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python 3 string handling and avoid reliance on `six` internals.","message":"The `six` dependency is deprecated as of Python 3. Future versions may remove it. Ensure your code is Python 3 compatible.","severity":"deprecated","affected_versions":"<=0.11.0"}],"env_vars":null,"search_vec":"'0.11.0':11 'activ':12 'api':9,18 'client':5,19 'develop':13 'irregular':14 'lightweight':3 'mediawiki':8,16 'mwclient':1 'python':4 'releas':15 'version':10 'wiki':17","created_at":"2026-06-07T12:55:19.108732+00:00","updated_at":"2026-06-07T12:55:19.108732+00:00","problems":[{"fix":"Ensure you are using a bot password (not your main password) and double-check credentials.","cause":"Incorrect username/password or bot password not used.","error":"mwclient.errors.LoginError: Login failed"},{"fix":"Use `import mwclient; site = mwclient.Site(...)` instead of `from mwclient import client`.","cause":"Importing from a non-existent submodule.","error":"AttributeError: module 'mwclient' has no attribute 'client'"},{"fix":"Verify site URL (e.g., 'en.wikipedia.org') and internet connection.","cause":"Network issue or incorrect site URL.","error":"requests.exceptions.ConnectionError: ... Name or service not known"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/mwclient/mwclient","github":"https://github.com/mwclient/mwclient","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","analytics"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}