Skip to main content

Async Mediawiki Python library

Project description

async-mediawiki

An asynchronous python libary to get mediawiki content

Codacy Badge BCH compliance FOSSA Status Code style: black

Installation

It requires Python 3.6 or above and aiohttp

pip3 install async-mediawiki

Development Version:

pip3 install git+https://github.com/Gelbpunkt/async-mediawiki

Usage

import async_mediawiki as mw

wiki = mw.Wiki("wiki api url here") #make a Wiki object which is the key to the library
wiki = mw.Wiki.wikipedia("en") #alternate constructor for Wikipedia Wikis
await wiki.create_account("test", "pass1234") #create an account in the wiki
await wiki.login("test", "pass1234") #login with the newly made user
await wiki.get_random_pages(3) #get a list of pages

page = wiki.get_page("Mediawiki") #get a specific page
print(await page.html) #print the pure page html
print(await page.markdown) #print the pure page markdown (wiki code)
print(await page.text) #print the page's text (library handled filtering of the HTML)

await page.edit("That's a nice lib!") #edit the page, automatically uses the logged in user or anonymous
await wiki.close() #the Wiki object also supports a context manager (async with) to close automatically

License

FOSSA Status

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
async_mediawiki-0.2.0-py3-none-any.whl (5.4 kB) Copy SHA256 hash SHA256 Wheel py3
async_mediawiki-0.2.0.tar.gz (4.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page