lab156 / unwiki

Python module to remove wiki markup text.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unwiki

Python module to remove wiki markup text.

Unwiki has two methods: unwiki.load and unwiki.loads

>>> import unwiki

>>> unwiki.loads("[[Wiki Link]]")
"Wiki Link"

>>> with open('wiki.txt') as f:
... result = unwiki.load(f)

Use the compress_spaces option to remove extra spaces that may sneak in:

>>> unwiki.loads("[[Wiki Link]] {{template}} more")
"Wiki Link  more"

>>> unwiki.loads("[[Wiki Link]] {{template}} more", compress_spaces=True)
"Wiki Link more"

License

GNU Public License. See LICENSE.txt for more.

Inspired by dewiki by Dirk Dierickx.

About

Python module to remove wiki markup text.

License:GNU General Public License v3.0


Languages

Language:Python 91.8%Language:Makefile 8.2%