mwparserfromhell
MWParserFromHell is a parser for MediaWiki wikicode
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions (3.9+), and offers prebuilt wheels for common platforms. MIT licensing is permissive. Install friction is moderate due to the C extension, but fallback to pure Python is automatic. Recommended for any project that needs to parse or manipulate MediaWiki wikitext.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- If building from source and the C tokenizer extension fails to compile, set environment variable WITH_EXTENSION=0 to use the slower pure-Python fallback.
- Medium install friction due to a compiled C tokenizer extension, but prebuilt wheels are available for common platforms (Linux x86_64 and arm64, macOS x86_64 and arm64, Windows x86 and x86_64).
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
last release 2025-07-01 (409 days) · last repo commit 2026-07-28 · 896 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 906,873 downloads/mo, #4,757 on PyPI
Alternatives
Verify before relying
pip install mwparserfromhell
import mwparserfromhell
wikicode = mwparserfromhell.parse("{{template|param=value}}")
templates = wikicode.filter_templates()
print(templates[0].name)- Performance characteristics and parsing speed compared to pure-Python implementation when C extension is unavailable.
- Exact scope of MediaWiki syntax variants and edge cases the parser handles beyond the documented limitations.
What it is and what it does
mwparserfromhell is a parser for MediaWiki wikicode that converts raw wiki markup into a queryable object model. It provides methods to extract templates, links, sections, and other wiki elements from page text, and allows you to modify them programmatically before converting back to plain wikitext. The parser includes a fast compiled C tokenizer for most platforms, with an automatic fallback to pure Python if compilation fails.
The package is designed for direct source-code analysis rather than HTML rendering, which means it works with the raw wikitext as written. It handles nested structures (templates within templates, for example) and provides filtering and matching methods that account for MediaWiki conventions like case-insensitive template names. Common use cases include bot automation, content analysis, and wiki page editing workflows.
Use it for
- Extract and analyze all templates from a Wikipedia article to audit template usage or gather metadata.
- Modify template parameters programmatically in bulk wiki edits, such as updating deprecated template syntax across pages.
- Parse wiki markup to identify links, categories, and sections for content extraction or validation tasks.
- Build bots that read, analyze, and edit wiki pages by parsing the raw wikitext before and after modifications.
- Validate or normalize wikicode structure without rendering to HTML, useful for linting or preprocessing workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, supports current Python versions (3.9+), and offers prebuilt wheels for common platforms. MIT licensing is permissive. Install friction is moderate due to the C extension, but fallback to pure Python is automatic. Recommended for any project that needs to parse or manipulate MediaWiki wikitext.
Install
mwparserfromhell on PyPI
Before you install
Medium install friction due to a compiled C tokenizer extension, but prebuilt wheels are available for common platforms (Linux x86_64 and arm64, macOS x86_64 and arm64, Windows x86 and x86_64). Falls back to pure-Python implementation if the C extension cannot be built. Active maintenance with recent commits.
Requires Python 3.9 or later. If building from source and the C tokenizer extension fails to compile, set environment variable WITH_EXTENSION=0 to use the slower pure-Python fallback.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install mwparserfromhell
import mwparserfromhell
wikicode = mwparserfromhell.parse("{{template|param=value}}")
templates = wikicode.filter_templates()
print(templates[0].name)
Verify before relying
- Performance characteristics and parsing speed compared to pure-Python implementation when C extension is unavailable.
- Exact scope of MediaWiki syntax variants and edge cases the parser handles beyond the documented limitations.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 409 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 906,873 / month, #4,757 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Text Processing :: Markup |
Evidence: mwparserfromhell-0.7.2-cp310-cp310-macosx_10_9_x86_64.whl; mwparserfromhell-0.7.2-cp310-cp310-macosx_11_0_arm64.whl; mwparserfromhell-0.7.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; mwparserfromhell-0.7.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; mwparserfromhell-0.7.2-cp310-cp310-musllinux_1_2_aarch64.whl; mwparserfromhell-0.7.2-cp310-cp310-musllinux_1_2_x86_64.whl; mwparserfromhell-0.7.2-cp310-cp310-win32.whl; mwparserfromhell-0.7.2-cp310-cp310-win_amd64.whl; mwparserfromhell-0.7.2-cp311-cp311-macosx_10_9_x86_64.whl; mwparserfromhell-0.7.2-cp311-cp311-macosx_11_0_arm64.whl; mwparserfromhell-0.7.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; mwparserfromhell-0.7.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; mwparserfromhell-0.7.2-cp311-cp311-musllinux_1_2_aarch64.whl; mwparserfromhell-0.7.2-cp311-cp311-musllinux_1_2_x86_64.whl; mwparserfromhell-0.7.2-cp311-cp311-win32.whl; mwparserfromhell-0.7.2-cp311-cp311-win_amd64.whl; mwparserfromhell-0.7.2-cp312-cp312-macosx_10_13_x86_64.whl; mwparserfromhell-0.7.2-cp312-cp312-macosx_11_0_arm64.whl; mwparserfromhell-0.7.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; mwparserfromhell-0.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “mediawiki parser”
- mwparserfromhellParses MediaWiki wikicode into a queryable syntax tree, allowing you…
- wikitextparserParses and manipulates MediaWiki wikitext markup, extracting and…
- mwtypesProvides standardized Python classes for MediaWiki data types,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Markup packages
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.
Install it if you need reliable markdown-to-HTML conversion.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.
Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.
Parses and edits TOML files while preserving formatting, comments, and structure, then serializes them back with layout intact.
Install it if you're building tools that touch TOML files and user readability of the source matters.
Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.
Install it if you need to programmatically read and extract structured data from Python docstrings.
See also wikitextparser · wikipedia · mwcli · mwclient · pywikibot · mwtypes · mwxml · Wikipedia-API · zhconv · ntc-templates