{ "info": { "author": "Steve @siznax", "author_email": "steve@siznax.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "Wikipedia tools (for Humans)\n============================\n\n.. image:: https://img.shields.io/pypi/v/wptools.svg\n :target: https://pypi.python.org/pypi/wptools/\n\n.. image:: https://travis-ci.org/siznax/wptools.svg?branch=master\n :target: https://travis-ci.org/siznax/wptools\n\n.. image:: https://coveralls.io/repos/github/siznax/wptools/badge.svg?branch=master\n :target: https://coveralls.io/github/siznax/wptools\n\nPython and command-line MediaWiki access for Humans\n\n- get page extracts, image, Infobox data, Wikidata, and more\n- get a random page, category, or site\n- get page statistics\n- get category members\n- get site info and stats\n- get data in any language\n\nThis package is intended to make it as easy as possible to get data\nfrom MediaWiki instances, expose more Wikidata, and extend Wikimedia\nAPIs just for kicks. We say \"(for Humans)\" because that is a goal_.\nQuestions, feedback, and especially contributions_ are welcome!\n\n\nInstall\n-------\n\n.. code-block:: bash\n\n $ pip install wptools\n \u2728\ud83e\udd84\u2728\n\n\nExample\n-------\n\n.. code-block:: python\n\n >>> import wptools\n\n\nGet a page object:\n\n.. code-block:: python\n\n >>> page = wptools.page('Gandhi')\n\n\nGet `API:Query`_ data:\n\n.. _`API:Query`: https://www.mediawiki.org/wiki/API:Query\n\n.. code-block:: python\n\n >>> page.get_query()\n en.wikipedia.org (query) Gandhi\n en.wikipedia.org (imageinfo) File:Portrait Gandhi.jpg\n Mahatma Gandhi (en) data\n {\n aliases: M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...\n assessments: Pakistan, Alternative Views, South Afric...\n description: pre-eminent leader of Indian nationalism ...\n extext: Mah\u0101tm\u0101 **Mohandas Karamchand Gandhi** ( ; H...\n extract:

Mah\u0101tm\u0101 Mohandas Karamchand Gandhi {u'size': 2951123, 'kind': 'query-pageimage', u...\n label: Mahatma Gandhi\n length: 262,790\n links: 10 Janpath, 14th Dalai Lama, 1915 Singapore M...\n modified: page\n pageid: 19379\n random: Salt\n redirected: {u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}\n redirects: {u'ns': 0, u'pageid': 55342, u'title': u'M...\n requests: query, imageinfo\n title: Mahatma Gandhi\n url: https://en.wikipedia.org/wiki/Mahatma_Gandhi\n url_raw: https://en.wikipedia.org/wiki/Mahatma_Gandhi?action=raw\n watchers: 1,811\n wikibase: Q1001\n wikidata_url: https://www.wikidata.org/wiki/Q1001\n }\n\n\nGet `API:Parse`_ data:\n\n.. _`API:Parse`: https://www.mediawiki.org/wiki/API:Parse\n\n.. code-block:: python\n\n >>> page.get_parse()\n en.wikipedia.org (parse) Gandhi\n en.wikipedia.org (imageinfo) File:MKGandhi.jpg\n Mahatma Gandhi (en) data\n {\n image: {u'size': 2951123, 'kind': 'parse-image', u'des...\n infobox: known_for, other_names, image, signature, bi...\n iwlinks: https://biblio.wiki/wiki/Mohandas_K._Gandhi,...\n pageid: 19379\n parsetree: