Skip to main content

MediaWiki-compatible parser for Python.

Project description

A mediawiki-compatible parser for Python.

Current status:


To run the tests:

$ make -C tests

The test result can be found in tests/out/report.html.

A command line tool is available, too (installed as “mw”):

$ echo "''Hello World''" | python smc/mw/
<html><body><p><i>Hello World</i>


For specific differences, see the test results.

  • __TOC__ and other magic words must appear on a line on their own, while MediaWiki allows them everyhwere with some strange consequences.


  • Test 843: Section extraction, <pre> around bogus header (bug 10309) This should be fixed, as it affects parser extensions (math element, etc), too. For this, the preprocessor grammar needs to include specific (but not all) XML elements parsed (counterexample: div elements are transparent for headings, pre elements are not).


The parser uses the grako parser generator for PEG grammars by ResQSoft Inc. and Juancarlo Añez.


Project details

Download files

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

Files for, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size (777.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page