Skip to main content

Wikia API for Python

Project description

Wikia is a Python library that makes it easy to access and parse data from any wikia website <https://www.wikia.com>

Search a wikia, get article summaries, get data like links and images from a page, and more. Wikipedia wraps the Wikia API so you can focus on using wikia data, not getting it.

>>> import wikia
>>> print wikia.summary("Runescape", "Banshee")
# Banshees are Slayer monsters that require level 15 Slayer to kill. They frequently drop 13 noted pure essence, making them an alternative source of essence. Additionally, banshees tend to frequently drop many different types of herbs. Mighty banshees are a higher-levelled alternative, if this is given as your Slayer assignment.

>>> wikia.search("Runescape", "Forest")
# [u'Forest', u'Forester', u'Freaky Forester', u'Forester\'s Arms', u'Talking Forest', u'Jungle Forester', u'Dense forest', u'Forester hat', u'Ogre forester hat', u'Forester (Burgh de Rott Ramble)']

>>> drakan = wikia.page("Runescape", "Castle Drakan")
>>> drakan.title
# u'Castle Drakan'
>>> drakan.url
# u'http://runescape.wikia.com/wiki/Castle_Drakan'
>>> drakan.content
# u'Castle Drakan is the home of Lord Drakan, the vampyre lord of Morytania. Found just north of Meiyerditch, it looms over the Sanguinesti region'...

>>> wikia.set_lang("nl") # Dutch
>>> wikia.summary("Runescape", "Runes", sentences=1)
# Runes, of Magische runes zijn kleine gewichtloze steentjes waarmee spelers een spreuk kunnen uitvoeren.

Note: this library was designed for ease of use and simplicity, not for advanced use.

Installation

To install Wikia, simply run:

$ pip install wikia

Wikia is compatible with Python 2.6+ (2.7+ to run unittest discover) and Python 3.3+.

Documentation

Read the docs at http://api.wikia.com/wiki/Wikia_API_Wiki.

To run tests, clone the respository on GitHub, then run:

$ pip install -r requirements.txt
$ bash runtests  # will run tests for python and python3
$ python -m unittest discover wikia/tests/ '*test.py'  # manual style

in the root project directory.

To build the documentation yourself, after installing requirements.txt, run:

$ pip install sphinx
$ cd docs/
$ make html

License

MIT licensed. See the LICENSE file for full details.

Credits

  • wiki-api by @richardasaurus for inspiration

  • @nmoroze and @themichaelyang for feedback and suggestions

  • The Wikimedia Foundation for giving the world free access to data

  • @goldsmith for making such a fantastic library to fork

  • /u/captainmeta4 for giving the idea for a reddit bot to post game wiki info like auto-wiki bot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wikia-1.4.4.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

wikia-1.4.4-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file wikia-1.4.4.tar.gz.

File metadata

  • Download URL: wikia-1.4.4.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for wikia-1.4.4.tar.gz
Algorithm Hash digest
SHA256 8f9893513908cc89bd8b72b803654fc77ae1fbeb556b49be033555b93d80011d
MD5 f5fbfa1bda55c6e4dc70ac3f08f0c074
BLAKE2b-256 2bbe2d00ff8fe1145a97773b89b50bace2d2a03c58a6fbfd2b5f5466d3521017

See more details on using hashes here.

File details

Details for the file wikia-1.4.4-py3-none-any.whl.

File metadata

  • Download URL: wikia-1.4.4-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for wikia-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f6fdf73ac8bde1b013ae41c2ef2691307122910aed4de87ed12ca9ad5577f86a
MD5 2c619cc41b1132bd8154e2fffaeec7a3
BLAKE2b-256 b78328a60ec111f8657e685d489394bc2eebf77bff0c1fbdaf57b36a78a3f584

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page