Skip to main content

A basic asynchronous wrapper for the WikiMedia API

Project description

awiki

a basic asynchronous wrapper for the wikimedia API.

this currently only supports anonymous actions (ie., getting and searching for pages), and does not support editing or creating new pages.

installation

your favorite flavor of the following:

python3 -m pip install -U awiki

quick overview

the main class is awiki.WikiClient. Each section of the wikimedia API is separated within this class - for example, the currently supported sections are core - searching and getting previews of pages - and feed - getting daily featured articles etc.

examples

Searching for articles called "Python":

import asyncio

import awiki

async def main():
    # create a new instance of the wiki client
    wiki = awiki.WikiClient()

    # Searches wiki pages for the given search terms, and returns matching pages.
    pages = await wiki.search_content("Python", limit=25)

    for p in pages:
        print(f"{p.title}: {p.description} (https://en.wikipedia.org/wiki/{p.key})")


if __name__ == "__main__":
    asyncio.run(main())

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

awiki-1.0.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

awiki-1.0.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file awiki-1.0.2.tar.gz.

File metadata

  • Download URL: awiki-1.0.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for awiki-1.0.2.tar.gz
Algorithm Hash digest
SHA256 33d3a50c428d29ead4d09b1ba1f0e7df32a3142748f1547e3a7e9fb903274eb9
MD5 d8ae0b964658c641b59407b4be289fd1
BLAKE2b-256 740d71dc9c1200fbf74823c7774aa932844e1e5f75362c72312996833a632b7c

See more details on using hashes here.

File details

Details for the file awiki-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: awiki-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for awiki-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9de7492893ad26fb31c0df80e061fb73bb04dc2c6713b2403d9dffbe4104e0b9
MD5 1464d77d19101f3e248d8e44cc03391e
BLAKE2b-256 88d154fd046f031e25b647a697076607de36290e2935f96a6413b650b07f853c

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