commit python-wptools for openSUSE:Factory
Hello community,
here is the log from the commit of package python-wptools for openSUSE:Factory checked in at 2018-05-01 23:28:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wptools (Old)
and /work/SRC/openSUSE:Factory/.python-wptools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wptools"
Tue May 1 23:28:39 2018 rev:6 rq:602625 version:0.4.12
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-wptools/python-wptools.changes 2018-01-28 20:33:35.110436159 +0100
+++ /work/SRC/openSUSE:Factory/.python-wptools.new/python-wptools.changes 2018-05-01 23:28:41.193489374 +0200
@@ -1,0 +2,9 @@
+Mon Apr 30 19:10:36 UTC 2018 - badshah400@gmail.com
+
+- Update to version 0.4.12 [list of changes cumulated from version
+ 0.4.9]:
+ * Respect silence (gh#siznax/wptools#118).
+ * Added more general infobox parsing alternative.
+ * Improved infobox parsing.
+
+-------------------------------------------------------------------
Old:
----
wptools-0.4.8.tar.gz
New:
----
wptools-0.4.12.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-wptools.spec ++++++
--- /var/tmp/diff_new_pack.fwUcM2/_old 2018-05-01 23:28:45.109346986 +0200
+++ /var/tmp/diff_new_pack.fwUcM2/_new 2018-05-01 23:28:45.113346840 +0200
@@ -19,7 +19,7 @@
%define pyname wptools
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-wptools
-Version: 0.4.8
+Version: 0.4.12
Release: 0
Summary: Wikipedia tools (for Humans)
License: MIT
++++++ python-wptools-avoid-reading-readme.patch ++++++
--- /var/tmp/diff_new_pack.fwUcM2/_old 2018-05-01 23:28:45.141345822 +0200
+++ /var/tmp/diff_new_pack.fwUcM2/_new 2018-05-01 23:28:45.145345677 +0200
@@ -1,7 +1,7 @@
-Index: wptools-0.4.6/setup.py
+Index: wptools-0.4.12/setup.py
===================================================================
---- wptools-0.4.6.orig/setup.py
-+++ wptools-0.4.6/setup.py
+--- wptools-0.4.12.orig/setup.py
++++ wptools-0.4.12/setup.py
@@ -2,8 +2,6 @@
from setuptools import setup, find_packages
@@ -13,7 +13,7 @@
@@ -12,7 +10,16 @@ setup(
name='wptools',
- version='0.4.8',
+ version='0.4.12',
description='Wikipedia tools (for Humans)',
- long_description=readme + '\n\n' + history,
+ long_description=
++++++ wptools-0.4.8.tar.gz -> wptools-0.4.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/HISTORY.rst new/wptools-0.4.12/HISTORY.rst
--- old/wptools-0.4.8/HISTORY.rst 2018-01-19 22:27:38.000000000 +0100
+++ new/wptools-0.4.12/HISTORY.rst 2018-04-30 00:33:58.000000000 +0200
@@ -3,9 +3,11 @@
Release History
---------------
-0.4.8 (2018-01-19)
-++++++++++++++++++
+0.4.12 (2018-04-29)
++++++++++++++++++++
+* Always respect silent flag (#118)
+* Improved infobox parsing (#91, #109)
* Added image (license, assessment) metadata (#104, #105)
* Fixed Wikidata pageid, image bugs (#101, #102)
* Added support for category continuations, subcategories (#99)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/PKG-INFO new/wptools-0.4.12/PKG-INFO
--- old/wptools-0.4.8/PKG-INFO 2018-01-19 22:32:57.000000000 +0100
+++ new/wptools-0.4.12/PKG-INFO 2018-04-30 00:38:59.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: wptools
-Version: 0.4.8
+Version: 0.4.12
Summary: Wikipedia tools (for Humans)
Home-page: https://github.com/siznax/wptools/
Author: Steve @siznax
@@ -51,42 +51,161 @@
>>> import wptools
+ Get a page object:
+
.. code-block:: python
>>> page = wptools.page('Gandhi')
+ Get `API:Query`_ data:
+
+ .. _`API:Query`: https://www.mediawiki.org/wiki/API:Query
+
+ .. code-block:: python
+
+ >>> page.get_query()
+ en.wikipedia.org (query) Gandhi
+ en.wikipedia.org (imageinfo) File:Portrait Gandhi.jpg
+ Mahatma Gandhi (en) data
+ {
+ aliases: M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
+ assessments:
10 Janpath, 14th Dalai Lama, 1915 Singapore M...
+ modified:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
+ redirects:
{u'ns': 0, u'pageid': 55342, u'title': u'M...
+ requests:
query, imageinfo
+ title: Mahatma Gandhi
+ url: https://en.wikipedia.org/wiki/Mahatma_Gandhi
+ url_raw: https://en.wikipedia.org/wiki/Mahatma_Gandhi?action=raw
+ watchers: 1,811
+ wikibase: Q1001
+ wikidata_url: https://www.wikidata.org/wiki/Q1001
+ }
+
+
+ Get `API:Parse`_ data:
+
+ .. _`API:Parse`: https://www.mediawiki.org/wiki/API:Parse
+
+ .. code-block:: python
+
+ >>> page.get_parse()
+ en.wikipedia.org (parse) Gandhi
+ en.wikipedia.org (imageinfo) File:MKGandhi.jpg
+ Mahatma Gandhi (en) data
+ {
+ image:
{u'size': 2951123, 'kind': 'parse-image', u'des...
+ infobox:
https://biblio.wiki/wiki/Mohandas_K._Gandhi,...
+ pageid: 19379
+ parsetree:
parse, imageinfo
+ title: Mahatma Gandhi
+ wikibase: Q1001
+ wikidata_url: https://www.wikidata.org/wiki/Q1001
+ wikitext:
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
+ claims:
{u'size': 2951123, 'kind': 'wikidata-image', u'...
+ label: Mahatma Gandhi
+ labels:
wikidata, labels, labels, labels, labels, im...
+ title: Mahatma_Gandhi
+ what: human
+ wikibase: Q1001
+ wikidata:
{'kind': 'restbase-original', u'width': 2024, '...
+ pageid: 19379
+ requests:
restbase
+ title: Mahatma_Gandhi
+ url: https://en.wikipedia.org/wiki/Gandhi
+ url_raw: https://en.wikipedia.org/wiki/Gandhi?action=raw
+ }
+
+
+ Get all the things (at once):
+
.. code-block:: python
>>> page.get()
en.wikipedia.org (query) Gandhi
en.wikipedia.org (parse) 19379
www.wikidata.org (wikidata) Q1001
- www.wikidata.org (labels) Q1280678|P535|Q18338317|P434|Q1860|P376...
- www.wikidata.org (labels) P18|P19|P1066|P509|P345|Q16382|P1006|P3...
- www.wikidata.org (labels) Q2140674|Q1282294|Q21200566|P409|Q26490...
- www.wikidata.org (labels) P3417|P4431|P2949|P69|Q129286|Q9441|P42...
+ www.wikidata.org (labels) Q1280678|P535|P434|Q1860|P3762|Q668|P12...
+ www.wikidata.org (labels) P119|Q1930187|P691|P18|P19|P1066|P509|P...
+ www.wikidata.org (labels) Q6512732|Q1568|P972|Q84|P1430|P31|Q2140...
+ www.wikidata.org (labels) P1576|Q4964182|P1368|P140|Q22336956|P12...
en.wikipedia.org (restbase) /page/summary/Mahatma_Gandhi
- en.wikipedia.org (imageinfo) File:Portrait Gandhi.jpg|File:MKGandhi.jpg
+ en.wikipedia.org (imageinfo) File:MKGandhi.jpg|File:Portrait Gandhi.jpg
Mahatma Gandhi (en) data
{
aliases:
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
- claims:
https://biblio.wiki/wiki/Mohandas_K._Gandhi,...
label: Mahatma Gandhi
- labels:
10 Janpath, 14th Dalai Lama, 1915 Singapore M...
modified:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
redirects:
{u'ns': 0, u'pageid': 55342, u'title': u'M...
@@ -94,15 +213,18 @@
title: Mahatma_Gandhi
url: https://en.wikipedia.org/wiki/Mahatma_Gandhi
url_raw: https://en.wikipedia.org/wiki/Mahatma_Gandhi?action=raw
- watchers: 1,770
+ watchers: 1,811
what: human
wikibase: Q1001
- wikidata:
Category:1869 births, Category:1948 death...
- contributors: 2,608
- files:
File:Aum Om red.svg, File:Commons-logo.svg, Fi...
- languages:
{u'lang': u'af', u'title': u'Mahatma Gand...
- views: 24,565
+ contributors: 2,606
+ files:
File:Aum Om red.svg, File:Commons-logo.svg, Fi...
+ languages:
{u'lang': u'af', u'title': u'Mahatma Gand...
+ pageid: 19379
+ redirected:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
+ requests:
querymore
+ title: Mahatma Gandhi
+ views: 19,242
+ }
+
+
+ Get data in `another language`_:
+
+ .. _`another language`: https://github.com/siznax/wptools/wiki/Language-Codes
+
+ .. code-block:: python
+
+ >>> page = wptools.page(lang='zh')
+ zh.wikipedia.org (random) 🍰
+ 哈莉特·塔布曼 (zh) data
+ {
+ pageid: 211070
+ title: 哈莉特·塔布曼
+ }
+
+
+ Get data from `another wiki`_:
+
+ .. _`another wiki`: https://meta.wikimedia.org/wiki/List_of_Wikipedias
+
+ .. code-block:: python
+
+ >>> page = wptools.page(wiki='en.wikiquote.org')
+ en.wikiquote.org (random) 🍪
+ Malala_Yousafzai (en)
+ {
+ pageid: 146817
+ title: Malala_Yousafzai
}
@@ -139,9 +295,11 @@
Release History
---------------
- 0.4.8 (2018-01-19)
- ++++++++++++++++++
+ 0.4.12 (2018-04-29)
+ +++++++++++++++++++
+ * Always respect silent flag (#118)
+ * Improved infobox parsing (#91, #109)
* Added image (license, assessment) metadata (#104, #105)
* Fixed Wikidata pageid, image bugs (#101, #102)
* Added support for category continuations, subcategories (#99)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/README.rst new/wptools-0.4.12/README.rst
--- old/wptools-0.4.8/README.rst 2017-12-13 23:35:18.000000000 +0100
+++ new/wptools-0.4.12/README.rst 2018-02-07 00:55:30.000000000 +0100
@@ -42,42 +42,161 @@
>>> import wptools
+Get a page object:
+
.. code-block:: python
>>> page = wptools.page('Gandhi')
+Get `API:Query`_ data:
+
+.. _`API:Query`: https://www.mediawiki.org/wiki/API:Query
+
+.. code-block:: python
+
+ >>> page.get_query()
+ en.wikipedia.org (query) Gandhi
+ en.wikipedia.org (imageinfo) File:Portrait Gandhi.jpg
+ Mahatma Gandhi (en) data
+ {
+ aliases:
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
+ assessments:
10 Janpath, 14th Dalai Lama, 1915 Singapore M...
+ modified:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
+ redirects:
{u'ns': 0, u'pageid': 55342, u'title': u'M...
+ requests:
query, imageinfo
+ title: Mahatma Gandhi
+ url: https://en.wikipedia.org/wiki/Mahatma_Gandhi
+ url_raw: https://en.wikipedia.org/wiki/Mahatma_Gandhi?action=raw
+ watchers: 1,811
+ wikibase: Q1001
+ wikidata_url: https://www.wikidata.org/wiki/Q1001
+ }
+
+
+Get `API:Parse`_ data:
+
+.. _`API:Parse`: https://www.mediawiki.org/wiki/API:Parse
+
+.. code-block:: python
+
+ >>> page.get_parse()
+ en.wikipedia.org (parse) Gandhi
+ en.wikipedia.org (imageinfo) File:MKGandhi.jpg
+ Mahatma Gandhi (en) data
+ {
+ image:
{u'size': 2951123, 'kind': 'parse-image', u'des...
+ infobox:
https://biblio.wiki/wiki/Mohandas_K._Gandhi,...
+ pageid: 19379
+ parsetree:
parse, imageinfo
+ title: Mahatma Gandhi
+ wikibase: Q1001
+ wikidata_url: https://www.wikidata.org/wiki/Q1001
+ wikitext:
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
+ claims:
{u'size': 2951123, 'kind': 'wikidata-image', u'...
+ label: Mahatma Gandhi
+ labels:
wikidata, labels, labels, labels, labels, im...
+ title: Mahatma_Gandhi
+ what: human
+ wikibase: Q1001
+ wikidata:
{'kind': 'restbase-original', u'width': 2024, '...
+ pageid: 19379
+ requests:
restbase
+ title: Mahatma_Gandhi
+ url: https://en.wikipedia.org/wiki/Gandhi
+ url_raw: https://en.wikipedia.org/wiki/Gandhi?action=raw
+ }
+
+
+Get all the things (at once):
+
.. code-block:: python
>>> page.get()
en.wikipedia.org (query) Gandhi
en.wikipedia.org (parse) 19379
www.wikidata.org (wikidata) Q1001
- www.wikidata.org (labels) Q1280678|P535|Q18338317|P434|Q1860|P376...
- www.wikidata.org (labels) P18|P19|P1066|P509|P345|Q16382|P1006|P3...
- www.wikidata.org (labels) Q2140674|Q1282294|Q21200566|P409|Q26490...
- www.wikidata.org (labels) P3417|P4431|P2949|P69|Q129286|Q9441|P42...
+ www.wikidata.org (labels) Q1280678|P535|P434|Q1860|P3762|Q668|P12...
+ www.wikidata.org (labels) P119|Q1930187|P691|P18|P19|P1066|P509|P...
+ www.wikidata.org (labels) Q6512732|Q1568|P972|Q84|P1430|P31|Q2140...
+ www.wikidata.org (labels) P1576|Q4964182|P1368|P140|Q22336956|P12...
en.wikipedia.org (restbase) /page/summary/Mahatma_Gandhi
- en.wikipedia.org (imageinfo) File:Portrait Gandhi.jpg|File:MKGandhi.jpg
+ en.wikipedia.org (imageinfo) File:MKGandhi.jpg|File:Portrait Gandhi.jpg
Mahatma Gandhi (en) data
{
aliases:
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
- claims:
https://biblio.wiki/wiki/Mohandas_K._Gandhi,...
label: Mahatma Gandhi
- labels:
10 Janpath, 14th Dalai Lama, 1915 Singapore M...
modified:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
redirects:
{u'ns': 0, u'pageid': 55342, u'title': u'M...
@@ -85,15 +204,18 @@
title: Mahatma_Gandhi
url: https://en.wikipedia.org/wiki/Mahatma_Gandhi
url_raw: https://en.wikipedia.org/wiki/Mahatma_Gandhi?action=raw
- watchers: 1,770
+ watchers: 1,811
what: human
wikibase: Q1001
- wikidata:
Category:1869 births, Category:1948 death...
- contributors: 2,608
- files:
File:Aum Om red.svg, File:Commons-logo.svg, Fi...
- languages:
{u'lang': u'af', u'title': u'Mahatma Gand...
- views: 24,565
+ contributors: 2,606
+ files:
File:Aum Om red.svg, File:Commons-logo.svg, Fi...
+ languages:
{u'lang': u'af', u'title': u'Mahatma Gand...
+ pageid: 19379
+ redirected:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
+ requests:
querymore
+ title: Mahatma Gandhi
+ views: 19,242
+ }
+
+
+Get data in `another language`_:
+
+.. _`another language`: https://github.com/siznax/wptools/wiki/Language-Codes
+
+.. code-block:: python
+
+ >>> page = wptools.page(lang='zh')
+ zh.wikipedia.org (random) 🍰
+ 哈莉特·塔布曼 (zh) data
+ {
+ pageid: 211070
+ title: 哈莉特·塔布曼
+ }
+
+
+Get data from `another wiki`_:
+
+.. _`another wiki`: https://meta.wikimedia.org/wiki/List_of_Wikipedias
+
+.. code-block:: python
+
+ >>> page = wptools.page(wiki='en.wikiquote.org')
+ en.wikiquote.org (random) 🍪
+ Malala_Yousafzai (en)
+ {
+ pageid: 146817
+ title: Malala_Yousafzai
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/setup.py new/wptools-0.4.12/setup.py
--- old/wptools-0.4.8/setup.py 2018-01-19 22:28:53.000000000 +0100
+++ new/wptools-0.4.12/setup.py 2018-04-30 00:34:14.000000000 +0200
@@ -10,7 +10,7 @@
setup(
name='wptools',
- version='0.4.8',
+ version='0.4.12',
description='Wikipedia tools (for Humans)',
long_description=readme + '\n\n' + history,
url='https://github.com/siznax/wptools/',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/wptools/__init__.py new/wptools-0.4.12/wptools/__init__.py
--- old/wptools-0.4.8/wptools/__init__.py 2018-01-19 22:29:05.000000000 +0100
+++ new/wptools-0.4.12/wptools/__init__.py 2018-04-30 00:34:32.000000000 +0200
@@ -18,7 +18,7 @@
__contact__ = "https://github.com/siznax/wptools"
__license__ = "MIT"
__title__ = "wptools"
-__version__ = "0.4.8"
+__version__ = "0.4.12"
from . import core
from . import query
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/wptools/core.py new/wptools-0.4.12/wptools/core.py
--- old/wptools-0.4.8/wptools/core.py 2018-01-12 20:54:36.000000000 +0100
+++ new/wptools-0.4.12/wptools/core.py 2018-04-10 04:16:35.000000000 +0200
@@ -104,7 +104,7 @@
self._set_data(action)
- if show:
+ if show and not self.flags.get('silent'):
self.show()
def _load_response(self, action):
@@ -122,7 +122,7 @@
except ValueError:
raise ValueError(_query)
- if data.get('warnings'):
+ if data.get('warnings') and not self.flags.get('silent'):
utils.stderr("API warning: %s" % data.get('warnings'))
if data.get('error'):
@@ -193,7 +193,7 @@
"""
Pretty-print instance data
"""
- if self.flags.get('silent') or not self.data:
+ if not self.data:
return
ptitle = self.params.get('title')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/wptools/page.py new/wptools-0.4.12/wptools/page.py
--- old/wptools-0.4.8/wptools/page.py 2018-01-19 18:53:17.000000000 +0100
+++ new/wptools-0.4.12/wptools/page.py 2018-04-10 04:12:09.000000000 +0200
@@ -297,6 +297,10 @@
"""
self.data['pageid'] = page.get('pageid')
+ assessments = page.get('pageassessments')
+ if assessments:
+ self.data['assessments'] = assessments
+
extract = page.get('extract')
if extract:
self.data['extract'] = extract
@@ -345,6 +349,9 @@
terms = page.get('terms')
if terms:
+ if terms.get('alias'):
+ self.data['aliases'] = terms['alias']
+
if terms.get('description'):
self.data['description'] = next(iter(terms['description']),
None)
@@ -471,7 +478,7 @@
self.get_restbase('/page/summary/', False, proxy, timeout)
- if show:
+ if show and not self.flags.get('silent'):
self.show()
else:
@@ -492,7 +499,7 @@
self.get_restbase('/page/summary/', False, proxy, timeout)
- if show:
+ if show and not self.flags.get('silent'):
self.show()
return self
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/wptools/query.py new/wptools-0.4.12/wptools/query.py
--- old/wptools-0.4.8/wptools/query.py 2018-01-19 18:53:17.000000000 +0100
+++ new/wptools-0.4.12/wptools/query.py 2018-02-07 00:15:11.000000000 +0100
@@ -69,7 +69,8 @@
"&pithumbsize=240"
"&pllimit=500"
"&ppprop=disambiguation|wikibase_item"
- "&prop=extracts|info|links|pageimages|pageprops|pageterms|redirects"
+ "&prop=extracts|info|links|pageassessments|pageimages|pageprops"
+ "|pageterms|redirects"
"&redirects"
"&rdlimit=500"
"&rnlimit=1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wptools-0.4.8/wptools/utils.py new/wptools-0.4.12/wptools/utils.py
--- old/wptools-0.4.8/wptools/utils.py 2017-12-16 00:43:13.000000000 +0100
+++ new/wptools-0.4.12/wptools/utils.py 2018-03-06 00:01:12.000000000 +0100
@@ -21,12 +21,31 @@
def get_infobox(ptree, boxterm="box"):
"""
- returns infobox
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
+ assessments:
10 Janpath, 14th Dalai Lama, 1915 Singapore M...
+ modified:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
+ redirects:
{u'ns': 0, u'pageid': 55342, u'title': u'M...
+ requests:
query, imageinfo
+ title: Mahatma Gandhi
+ url: https://en.wikipedia.org/wiki/Mahatma_Gandhi
+ url_raw: https://en.wikipedia.org/wiki/Mahatma_Gandhi?action=raw
+ watchers: 1,811
+ wikibase: Q1001
+ wikidata_url: https://www.wikidata.org/wiki/Q1001
+ }
+
+
+ Get `API:Parse`_ data:
+
+ .. _`API:Parse`: https://www.mediawiki.org/wiki/API:Parse
+
+ .. code-block:: python
+
+ >>> page.get_parse()
+ en.wikipedia.org (parse) Gandhi
+ en.wikipedia.org (imageinfo) File:MKGandhi.jpg
+ Mahatma Gandhi (en) data
+ {
+ image:
{u'size': 2951123, 'kind': 'parse-image', u'des...
+ infobox:
https://biblio.wiki/wiki/Mohandas_K._Gandhi,...
+ pageid: 19379
+ parsetree:
parse, imageinfo
+ title: Mahatma Gandhi
+ wikibase: Q1001
+ wikidata_url: https://www.wikidata.org/wiki/Q1001
+ wikitext:
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
+ claims:
{u'size': 2951123, 'kind': 'wikidata-image', u'...
+ label: Mahatma Gandhi
+ labels:
wikidata, labels, labels, labels, labels, im...
+ title: Mahatma_Gandhi
+ what: human
+ wikibase: Q1001
+ wikidata:
{'kind': 'restbase-original', u'width': 2024, '...
+ pageid: 19379
+ requests:
restbase
+ title: Mahatma_Gandhi
+ url: https://en.wikipedia.org/wiki/Gandhi
+ url_raw: https://en.wikipedia.org/wiki/Gandhi?action=raw
+ }
+
+
+ Get all the things (at once):
+
.. code-block:: python
>>> page.get()
en.wikipedia.org (query) Gandhi
en.wikipedia.org (parse) 19379
www.wikidata.org (wikidata) Q1001
- www.wikidata.org (labels) Q1280678|P535|Q18338317|P434|Q1860|P376...
- www.wikidata.org (labels) P18|P19|P1066|P509|P345|Q16382|P1006|P3...
- www.wikidata.org (labels) Q2140674|Q1282294|Q21200566|P409|Q26490...
- www.wikidata.org (labels) P3417|P4431|P2949|P69|Q129286|Q9441|P42...
+ www.wikidata.org (labels) Q1280678|P535|P434|Q1860|P3762|Q668|P12...
+ www.wikidata.org (labels) P119|Q1930187|P691|P18|P19|P1066|P509|P...
+ www.wikidata.org (labels) Q6512732|Q1568|P972|Q84|P1430|P31|Q2140...
+ www.wikidata.org (labels) P1576|Q4964182|P1368|P140|Q22336956|P12...
en.wikipedia.org (restbase) /page/summary/Mahatma_Gandhi
- en.wikipedia.org (imageinfo) File:Portrait Gandhi.jpg|File:MKGandhi.jpg
+ en.wikipedia.org (imageinfo) File:MKGandhi.jpg|File:Portrait Gandhi.jpg
Mahatma Gandhi (en) data
{
aliases:
M K Gandhi, Mohandas Gandhi, Bapu, Gandhi, M...
- claims:
https://biblio.wiki/wiki/Mohandas_K._Gandhi,...
label: Mahatma Gandhi
- labels:
10 Janpath, 14th Dalai Lama, 1915 Singapore M...
modified:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
redirects:
{u'ns': 0, u'pageid': 55342, u'title': u'M...
@@ -94,15 +213,18 @@
title: Mahatma_Gandhi
url: https://en.wikipedia.org/wiki/Mahatma_Gandhi
url_raw: https://en.wikipedia.org/wiki/Mahatma_Gandhi?action=raw
- watchers: 1,770
+ watchers: 1,811
what: human
wikibase: Q1001
- wikidata:
Category:1869 births, Category:1948 death...
- contributors: 2,608
- files:
File:Aum Om red.svg, File:Commons-logo.svg, Fi...
- languages:
{u'lang': u'af', u'title': u'Mahatma Gand...
- views: 24,565
+ contributors: 2,606
+ files:
File:Aum Om red.svg, File:Commons-logo.svg, Fi...
+ languages:
{u'lang': u'af', u'title': u'Mahatma Gand...
+ pageid: 19379
+ redirected:
{u'to': u'Mahatma Gandhi', u'from': u'Gandhi'}
+ requests:
querymore
+ title: Mahatma Gandhi
+ views: 19,242
+ }
+
+
+ Get data in `another language`_:
+
+ .. _`another language`: https://github.com/siznax/wptools/wiki/Language-Codes
+
+ .. code-block:: python
+
+ >>> page = wptools.page(lang='zh')
+ zh.wikipedia.org (random) 🍰
+ 哈莉特·塔布曼 (zh) data
+ {
+ pageid: 211070
+ title: 哈莉特·塔布曼
+ }
+
+
+ Get data from `another wiki`_:
+
+ .. _`another wiki`: https://meta.wikimedia.org/wiki/List_of_Wikipedias
+
+ .. code-block:: python
+
+ >>> page = wptools.page(wiki='en.wikiquote.org')
+ en.wikiquote.org (random) 🍪
+ Malala_Yousafzai (en)
+ {
+ pageid: 146817
+ title: Malala_Yousafzai
}
@@ -139,9 +295,11 @@
Release History
---------------
- 0.4.8 (2018-01-19)
- ++++++++++++++++++
+ 0.4.12 (2018-04-29)
+ +++++++++++++++++++
+ * Always respect silent flag (#118)
+ * Improved infobox parsing (#91, #109)
* Added image (license, assessment) metadata (#104, #105)
* Fixed Wikidata pageid, image bugs (#101, #102)
* Added support for category continuations, subcategories (#99)
participants (1)
-
root@hilbert.suse.de