NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #4467 most downloaded on PyPI
MWParserFromHell is a parser for MediaWiki wikicode
Latest stable
0.7.2
Last release 1 years ago
01 Jul 2025
Release timing varies
gaps range from 2 months to 1.6 years
Nearly every release is documented
notes for 26 of 26 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
26 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
Fix building on non-CPython implementations like PyPy.
Released July 1, 2025 (changes):
Fix building on non-CPython implementations like PyPy. (#341)
Improve typing.
Explicitly support $WITH_EXTENSION/$WITHOUT_EXTENSION to control whether the C tokenizer should be built.
$WITH_EXTENSION/$WITHOUT_EXTENSION to control whether the C tokenizer should be built.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Released June 30, 2025 (changes):
Modernize packaging.
Explicitly support $WITH_EXTENSION / $WITHOUT_EXTENSION to control whether the C tokenizer should be built.
Fix building in C23 (e.g. in GCC 15). (#340)
Dropped support for end-of-life Python 3.8.
after parameter to Template.add(). (#281, #315)Template.update() method to set multiple parameters at once. (#337)Dropped support for end-of-life Python 3.7.
Released January 4, 2024 (changes):
Dropped support for end-of-life Python 3.7.
Added support for Python 3.12.
Raised nested node depth limit from 40 to 100 to match current MediaWiki. (#313)
Dropped support for end-of-life Python 3.6.
Dropped support for end-of-life Python 3.5.
Fixed C integer conversion, manifesting as parsing errors on big-endian platforms.
Improved parsing of external links.
Breaking change: dropped support for end-of-life Python 2.7 and 3.4.
Thanks to everyone for their patience with this release!
Wikicode.matches() to recognize underscores as being equivalent to spaces. (#216)default parameter to Template.get(), and implement dict-style item access for template parameters. (#252)Fixed an unlikely crash in the C tokenizer when interrupted while parsing a heading.
Released May 15, 2019 (changes):
Fixed an unlikely crash in the C tokenizer when interrupted while parsing a heading.
Fixed manual construction of Node objects, previously unsupported.
replace(), remove(), etc.) when passed an empty section as an argument. (#212)Dropped support for end-of-life Python versions 2.6, 3.2, 3.3. (#199, #204)
Improved behavior when adding parameters to templates (via Template.add()) with poorly formatted whitespace conventions.
Template.add()) with poorly formatted whitespace conventions. (#185)Added Wikicode.contains() to determine whether a Node or Wikicode object is contained within another Wikicode object.
Wikicode.contains() to determine whether a Node or Wikicode object is
contained within another Wikicode object.Wikicode.get_ancestors() and Wikicode.get_parent() to find all
ancestors and the direct parent of a Node, respectively.Template.remove(keep_field=True) behave more reasonably when the
parameter is already empty.keep_template_params argument to Wikicode.strip_code(). If True,
then template parameters will be preserved in the output.Wikicode.matches()'s behavior on iterables besides lists and tuples.wikitables nested in templates;
Released December 30, 2016 (changes):
Added support for Python 3.6.
Fixed parsing bugs involving:
wikitables nested in templates;
wikitable error recovery when unable to recurse;
templates nested in template parameters before other parameters.
Fixed parsing file-like objects.
Made builds deterministic.
Documented caveats.
Added Windows binaries for Python 3.5.
Released October 29, 2015 (changes):
Added Windows binaries for Python 3.5.
Fixed edge cases involving wikilinks inside of external links and vice versa.
Fixed a C tokenizer crash when a keyboard interrupt happens while parsing.
Fixed setup script not including header files in releases.
Released July 30, 2015 (changes):
Fixed setup script not including header files in releases.
Fixed Windows binary uploads.
The process for building Windows binaries has been fixed, and these should be distributed along with new releases. Windows users can now take advantag
< and > are now disallowed in wikilink titles and template names. This includes when denoting tags, but not comments.preserve_spacing in Template.add() and keep_field in Template.remove() on parameters with hidden keys._ListProxy.detach(). SmartLists now use weak references and their children are garbage-collected properly.SmartList, including one that was causing memory issues on 64-bit builds of Python 2 on Windows.The parser now falls back on pure Python mode if C extensions cannot be built. This fixes an issue that prevented some Windows users from installing t
scripts/memtest.py.scripts/release.sh.skip_style_tags can now be passed to mwparserfromhell.parse() (previously,
only Parser().parse() allowed it).recursive argument to Wikicode's filter methods now accepts a third
option, RECURSE_OTHERS, which recurses over all children except instances of
forcetype (for example, code.filter_templates(code.RECURSE_OTHERS)
returns all un-nested templates).Attribute's quoted attribute has been changed to quotes,
and is now either a string or None.Template.remove() with a Parameter object that is not part of the
template now raises ValueError instead of doing nothing.showkey=False, nor have the value of this attribute be set to False later._ListProxy.destroy() has been changed to _ListProxy.detach(), and now works
in a more useful way.ParserError will now be raised.
Previously, the parser would produce an unclear BadRoute exception or allow
an incorrect node tree to be build.<nowiki> tags.NOWEB environment variable, which disables a unit test
that makes a web call.This fixes a bug when adding parameters to templates with empty fields, and is a breaking change if you rely on the default behavior.
Template.has() is now passed ignore_empty=False by default instead of True.
This fixes a bug when adding parameters to templates with empty fields, and
is a breaking change if you rely on the default behavior.matches argument of Wikicode's filter methods now accepts a function
(taking one argument, a Node, and returning a bool) in addition to a regex.flat argument to Wikicode.get_sections(), fixed the order in which
it returns sections, and made it faster.Wikicode.matches() now accepts a tuple or list of strings/Wikicode objects
instead of just a single string or Wikicode.skip_style_tags argument to parse() that ignores '' and
''' until these issues are corrected.Added support for Python 3.2 (along with current support for 3.3 and 2.7).
Template.remove()'s first argument from name to param, which now accepts Parameter objects in addition to parameter name strings.Released September 1, 2013 (changes):
Added support for Python 3.2 (along with current support for 3.3 and 2.7).
Renamed .Template.remove's first argument from name to param, which now accepts .Parameter objects in addition to parameter name strings.
Fixed a parser bug involving URLs nested inside other markup.
Released August 29, 2013 (changes):
Fixed a parser bug involving URLs nested inside other markup.
Fixed some typos.
Wikicode.filter() methods are now passed recursive=True by default instead of False. This is a breaking change if you rely on any `filter()` methods b…
<ref>foo</ref>, <ref name="bar"/>, and wiki-markup tags like bold ('''), italics (''), and lists (*, #, ; and :).http://example.com/ and [http://example.com/ Example]).Wikicode.filter() methods are now passed recursive=True by default instead of False. This is a breaking change if you rely on any filter() methods being non-recursive by default.matches() method to Wikicode for page/template name comparisons.obj param of Wikicode.insert_before(), insert_after(), replace(), and remove() now accepts Wikicode objects and strings representing parts of wikitext, instead of just nodes. These methods also make all possible substitutions instead of just one.Template.has_param() to Template.has() for consistency with Template's other methods; has_param() is now an alias.Released August 24, 2013 (changes):
Added complete support for HTML Tags, including forms like <ref>foo</ref>, <ref name="bar"/>, and wiki-markup tags like bold ('''), italics (''), and lists (*, #, ; and :).
Added support for .ExternalLinks (http://example.com/ and [http://example.com/ Example]).
Wikicode's .filter methods are now passed recursive=True by default instead of False. This is a breaking change if you rely on any filter() methods being non-recursive by default.
Added a .matches method to .Wikicode for page/template name comparisons.
The obj param of .Wikicode.insert_before, .insert_after, ~.Wikicode.replace, and ~.Wikicode.remove now accepts .Wikicode objects and strings representing parts of wikitext, instead of just nodes. These methods also make all possible substitutions instead of just one.
Renamed .Template.has_param to ~.Template.has for consistency with .Template's other methods; .has_param is now an alias.
The C tokenizer extension now works on Python 3 in addition to Python 2.7.
Various bugfixes, internal changes, and cleanup.
The parser now fully supports Python 3 in addition to Python 2.7.
mwparserfromhell.parser.use_c to a boolean value.Wikicode.filter_links() to filter_wikilinks() (applies to ifilter as
well).before param to Template.add(); renamed force_nonconformity to
preserve_spacing.include_lead param to Wikicode.get_sections().flat param from Wikicode.get_sections().force_no_field param from Template.remove().SmartList and StringMixIn.Added support for Comments (<!-- foo -->) and Wikilinks ([[foo]]).
<!-- foo -->) and Wikilinks ([[foo]]).ifilter_links() and filter_links() methods to Wikicode.strip_code() to affect the contents of headings.Released September 21, 2012 (changes):
Added support for Comments (<!-- foo -->) and Wikilinks ([[foo]]).
Added corresponding .ifilter_links and .filter_links methods to .Wikicode.
Fixed a bug when parsing incomplete templates.
Fixed .strip_code to affect the contents of headings.
Various copyedits in documentation and comments.
- Initial release.
One column per quarter.