Skip to main content

Convert wikitext to HTML

Project description


GitHub License GitHub Tag GitHub commits since latest release

GitHub Workflow Status (Testing) GitHub Workflow Status (Release)

wikitexthtml is a library that renders HTML from WikiText.


  • Python3.8 or higher.
  • python-slugify (via, for slugs in anchors
  • ply (via, to implement {{#ifexpr}} and {{#expr}}
  • wikitextparser (via, to make sense of wikitext


pip install wikitexthtml

Or for development work:

python3 -m venv .env
.env/bin/pip install -e .


Extend Page by implementing the missing functions as seen in This way you can customize where files are read from (from disk, from a database, etc) and how to sanitize titles and URLs. In the tests folder examples of this can be found.

Now you can instantiate this new class and call render() on it. The result will be available in html. For example:

class WikiPage(Page):

print(WikiPage("Main Page").render().html)

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

wikitexthtml-1.1.2.tar.gz (27.1 kB view hashes)

Uploaded source

Built Distribution

wikitexthtml-1.1.2-py3-none-any.whl (37.4 kB view hashes)

Uploaded py3

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