pymediawiki


Namepymediawiki JSON
Version 0.7.5 PyPI version JSON
download
home_pagehttps://github.com/barrust/mediawiki
SummaryWikipedia and MediaWiki API wrapper for Python
upload_time2024-12-20 14:36:07
maintainerNone
docs_urlNone
authorTyler Barrus
requires_python>=3.6
licenseMIT
keywords python mediawiki wikipedia api wiki parser natural language processing nlp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            MediaWiki
=========

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
    :target: https://opensource.org/licenses/MIT/
    :alt: License
.. image:: https://img.shields.io/github/release/barrust/mediawiki.svg
    :target: https://github.com/barrust/mediawiki/releases
    :alt: GitHub release
.. image:: https://github.com/barrust/mediawiki/workflows/Python%20package/badge.svg
    :target: https://github.com/barrust/mediawiki/actions?query=workflow%3A%22Python+package%22
    :alt: Build Status
.. image:: https://codecov.io/gh/barrust/mediawiki/branch/master/graph/badge.svg?token=OdETiNgz9k
    :target: https://codecov.io/gh/barrust/mediawiki
    :alt: Test Coverage
.. image:: https://app.codacy.com/project/badge/Grade/34162198611f4aa0bde630d1dab72ce8
    :target: https://www.codacy.com/gh/barrust/mediawiki/dashboard?utm_source=github.com&utm_medium=referral&utm_content=barrust/mediawiki&utm_campaign=Badge_Grade
    :alt: Codacy Review
.. image:: https://badge.fury.io/py/pymediawiki.svg
    :target: https://badge.fury.io/py/pymediawiki
    :alt: PyPi Release
.. image:: http://pepy.tech/badge/pymediawiki
    :target: https://pepy.tech/project/pymediawiki
    :alt: Downloads

***mediawiki*** is a python wrapper and parser for the MediaWiki API. The goal
is to allow users to quickly and efficiently pull data from the MediaWiki site
of their choice instead of worrying about dealing directly with the API. As
such, it does not force the use of a particular MediaWiki site. It defaults to
`Wikipedia <http://www.wikipedia.org>`__ but other MediaWiki sites can
also be used.

MediaWiki wraps the `MediaWiki API <https://www.mediawiki.org/wiki/API>`_
so you can focus on *leveraging* your favorite MediaWiki site's data,
not getting it. Please check out the code on
`github <https://www.github.com/barrust/mediawiki>`_!

**Note:** this library was designed for ease of use and simplicity. If you plan
on doing serious scraping, automated requests, or editing, please look into
`Pywikibot <https://www.mediawiki.org/wiki/Manual:Pywikibot>`__
which has a larger API, advanced rate limiting, and other features so we may
be considerate of the MediaWiki infrastructure. Pywikibot has also other extra
features such as support for Wikibase (that runs Wikidata).


Installation
------------------

Pip Installation:

::

    $ pip install pymediawiki

To install from source:

To install ``mediawiki``, simply clone the `repository on GitHub
<https://github.com/barrust/mediawiki>`__, then run from the folder:

::

    $ python setup.py install

``mediawiki`` supports python versions 3.7 - 3.13

For *python 2.7* support, install `release 0.6.7 <https://github.com/barrust/mediawiki/releases/tag/v0.6.7>`__

::

    $ pip install pymediawiki==0.6.7

Documentation
-------------

Documentation of the latest release is hosted on
`readthedocs.io <http://pymediawiki.readthedocs.io/en/latest/?>`__

To build the documentation yourself run:

::

    $ pip install sphinx
    $ cd docs/
    $ make html

Automated Tests
------------------

To run automated tests, one must simply run the following command from the
downloaded folder:

::

  $ python setup.py test


Quickstart
------------------

Import mediawiki and run a standard search against Wikipedia:

.. code:: python

    >>> from mediawiki import MediaWiki
    >>> wikipedia = MediaWiki()
    >>> wikipedia.search('washington')

Run more advanced searches:

.. code:: python

    >>> wikipedia.opensearch('washington')
    >>> wikipedia.allpages('a')
    >>> wikipedia.geosearch(title='washington, d.c.')
    >>> wikipedia.geosearch(latitude='0.0', longitude='0.0')
    >>> wikipedia.prefixsearch('arm')
    >>> wikipedia.random(pages=10)

Pull a MediaWiki page and some of the page properties:

.. code:: python

    >>> p = wikipedia.page('Chess')
    >>> p.title
    >>> p.summary
    >>> p.categories
    >>> p.images
    >>> p.links
    >>> p.langlinks

See the `documentation for more examples!
<http://pymediawiki.readthedocs.io/en/latest/quickstart.html#quickstart>`_



Changelog
------------------

Please see the `changelog
<https://github.com/barrust/mediawiki/blob/master/CHANGELOG.md>`__ for a list
of all changes.


License
-------

MIT licensed. See the `LICENSE file
<https://github.com/barrust/Wikipedia/blob/master/LICENSE>`__
for full details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/barrust/mediawiki",
    "name": "pymediawiki",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python, mediawiki, wikipedia, API, wiki, parser, natural language processing, nlp",
    "author": "Tyler Barrus",
    "author_email": "barrust@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fc/4e/eec5f39d2ed22d10c6580be5ed54b99e867a20057815d62a0f3809a6ca4a/pymediawiki-0.7.5.tar.gz",
    "platform": null,
    "description": "MediaWiki\n=========\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n    :target: https://opensource.org/licenses/MIT/\n    :alt: License\n.. image:: https://img.shields.io/github/release/barrust/mediawiki.svg\n    :target: https://github.com/barrust/mediawiki/releases\n    :alt: GitHub release\n.. image:: https://github.com/barrust/mediawiki/workflows/Python%20package/badge.svg\n    :target: https://github.com/barrust/mediawiki/actions?query=workflow%3A%22Python+package%22\n    :alt: Build Status\n.. image:: https://codecov.io/gh/barrust/mediawiki/branch/master/graph/badge.svg?token=OdETiNgz9k\n    :target: https://codecov.io/gh/barrust/mediawiki\n    :alt: Test Coverage\n.. image:: https://app.codacy.com/project/badge/Grade/34162198611f4aa0bde630d1dab72ce8\n    :target: https://www.codacy.com/gh/barrust/mediawiki/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=barrust/mediawiki&amp;utm_campaign=Badge_Grade\n    :alt: Codacy Review\n.. image:: https://badge.fury.io/py/pymediawiki.svg\n    :target: https://badge.fury.io/py/pymediawiki\n    :alt: PyPi Release\n.. image:: http://pepy.tech/badge/pymediawiki\n    :target: https://pepy.tech/project/pymediawiki\n    :alt: Downloads\n\n***mediawiki*** is a python wrapper and parser for the MediaWiki API. The goal\nis to allow users to quickly and efficiently pull data from the MediaWiki site\nof their choice instead of worrying about dealing directly with the API. As\nsuch, it does not force the use of a particular MediaWiki site. It defaults to\n`Wikipedia <http://www.wikipedia.org>`__ but other MediaWiki sites can\nalso be used.\n\nMediaWiki wraps the `MediaWiki API <https://www.mediawiki.org/wiki/API>`_\nso you can focus on *leveraging* your favorite MediaWiki site's data,\nnot getting it. Please check out the code on\n`github <https://www.github.com/barrust/mediawiki>`_!\n\n**Note:** this library was designed for ease of use and simplicity. If you plan\non doing serious scraping, automated requests, or editing, please look into\n`Pywikibot <https://www.mediawiki.org/wiki/Manual:Pywikibot>`__\nwhich has a larger API, advanced rate limiting, and other features so we may\nbe considerate of the MediaWiki infrastructure. Pywikibot has also other extra\nfeatures such as support for Wikibase (that runs Wikidata).\n\n\nInstallation\n------------------\n\nPip Installation:\n\n::\n\n    $ pip install pymediawiki\n\nTo install from source:\n\nTo install ``mediawiki``, simply clone the `repository on GitHub\n<https://github.com/barrust/mediawiki>`__, then run from the folder:\n\n::\n\n    $ python setup.py install\n\n``mediawiki`` supports python versions 3.7 - 3.13\n\nFor *python 2.7* support, install `release 0.6.7 <https://github.com/barrust/mediawiki/releases/tag/v0.6.7>`__\n\n::\n\n    $ pip install pymediawiki==0.6.7\n\nDocumentation\n-------------\n\nDocumentation of the latest release is hosted on\n`readthedocs.io <http://pymediawiki.readthedocs.io/en/latest/?>`__\n\nTo build the documentation yourself run:\n\n::\n\n    $ pip install sphinx\n    $ cd docs/\n    $ make html\n\nAutomated Tests\n------------------\n\nTo run automated tests, one must simply run the following command from the\ndownloaded folder:\n\n::\n\n  $ python setup.py test\n\n\nQuickstart\n------------------\n\nImport mediawiki and run a standard search against Wikipedia:\n\n.. code:: python\n\n    >>> from mediawiki import MediaWiki\n    >>> wikipedia = MediaWiki()\n    >>> wikipedia.search('washington')\n\nRun more advanced searches:\n\n.. code:: python\n\n    >>> wikipedia.opensearch('washington')\n    >>> wikipedia.allpages('a')\n    >>> wikipedia.geosearch(title='washington, d.c.')\n    >>> wikipedia.geosearch(latitude='0.0', longitude='0.0')\n    >>> wikipedia.prefixsearch('arm')\n    >>> wikipedia.random(pages=10)\n\nPull a MediaWiki page and some of the page properties:\n\n.. code:: python\n\n    >>> p = wikipedia.page('Chess')\n    >>> p.title\n    >>> p.summary\n    >>> p.categories\n    >>> p.images\n    >>> p.links\n    >>> p.langlinks\n\nSee the `documentation for more examples!\n<http://pymediawiki.readthedocs.io/en/latest/quickstart.html#quickstart>`_\n\n\n\nChangelog\n------------------\n\nPlease see the `changelog\n<https://github.com/barrust/mediawiki/blob/master/CHANGELOG.md>`__ for a list\nof all changes.\n\n\nLicense\n-------\n\nMIT licensed. See the `LICENSE file\n<https://github.com/barrust/Wikipedia/blob/master/LICENSE>`__\nfor full details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Wikipedia and MediaWiki API wrapper for Python",
    "version": "0.7.5",
    "project_urls": {
        "Homepage": "https://github.com/barrust/mediawiki"
    },
    "split_keywords": [
        "python",
        " mediawiki",
        " wikipedia",
        " api",
        " wiki",
        " parser",
        " natural language processing",
        " nlp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "128f9d3637ee30759a19908b81b6123161d16f637daab7dc4e3a8f791ea56232",
                "md5": "feef333d8dc2ab52bfd5f9b7999d998f",
                "sha256": "78642bd95c470246ed48598958a1eb30c5c51245f5767f4cad1bf4dcfde75511"
            },
            "downloads": -1,
            "filename": "pymediawiki-0.7.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "feef333d8dc2ab52bfd5f9b7999d998f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 27385,
            "upload_time": "2024-12-20T14:36:04",
            "upload_time_iso_8601": "2024-12-20T14:36:04.325048Z",
            "url": "https://files.pythonhosted.org/packages/12/8f/9d3637ee30759a19908b81b6123161d16f637daab7dc4e3a8f791ea56232/pymediawiki-0.7.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fc4eeec5f39d2ed22d10c6580be5ed54b99e867a20057815d62a0f3809a6ca4a",
                "md5": "39a646bcee90687f610c61440bd96a71",
                "sha256": "6d17c1bf9750110c2dc2203f82cdda209f3e84ed32443356942f3eb5c8a0ec25"
            },
            "downloads": -1,
            "filename": "pymediawiki-0.7.5.tar.gz",
            "has_sig": false,
            "md5_digest": "39a646bcee90687f610c61440bd96a71",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 1673832,
            "upload_time": "2024-12-20T14:36:07",
            "upload_time_iso_8601": "2024-12-20T14:36:07.272142Z",
            "url": "https://files.pythonhosted.org/packages/fc/4e/eec5f39d2ed22d10c6580be5ed54b99e867a20057815d62a0f3809a6ca4a/pymediawiki-0.7.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 14:36:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "barrust",
    "github_project": "mediawiki",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymediawiki"
}
        
Elapsed time: 0.42183s