Skip to main content

A basic asynchronous wrapper for the WikiMedia API

Project description

awiki

a basic asynchronous wrapper for the wikimedia API.

awiki 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.

  • WikiClient.core: Searching for pages and getting file data

  • WikiClient.feed: Getting featured content such as things in the news and

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.3.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: awiki-1.0.3.tar.gz
  • Upload date:
  • Size: 10.2 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.3.tar.gz
Algorithm Hash digest
SHA256 3aad1c706f90a22123006d44901664612c042be7ff125a454fbc0809a28cc0a1
MD5 31d387e468ed992057abfabfeb5b9c71
BLAKE2b-256 9e34769b99ba54996102c9f9b5805d383bbc76053858ade0b85eb68f15b3b2eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: awiki-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 07da69c8f327a27ee842fcb1d68714ff0d9cebed60359cda2205eac09cf174ea
MD5 47db62fe8be99a57d91ba72d26311eba
BLAKE2b-256 d69baccc07b01f27a370ca7808eb45e8a8b0f83d144d349a1e4878d5e979b232

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