Async Mediawiki Python libary
Project description
async-mediawiki
An asynchronous python libary to get mediawiki content
Installation
It requires Python 3.6 or above and aiohttp
pip3 install 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
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 = await 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
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
async_mediawiki-0.1.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for async_mediawiki-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe1c188b2532dded17faa897417a84da9576f4179a683367f703628f01d70f20 |
|
MD5 | 584ef8d8a91acdb332e9460792a72d93 |
|
BLAKE2b-256 | ed596b1439da56350bd71f4e80e28b2c3c9061caef0561c1286f347f8ea6dbe4 |