{"id":24836,"library":"wikitextparser","title":"wikitextparser","description":"A simple parsing tool for MediaWiki's wikitext markup. Current version: 0.56.4. Releases follow no fixed cadence.","status":"active","version":"0.56.4","language":"python","source_language":"en","source_url":"https://github.com/5j9/wikitextparser","tags":["mediawiki","wikitext","parsing"],"install":[{"cmd":"pip install wikitextparser","lang":"bash","label":"Install wikitextparser"}],"dependencies":[],"imports":[{"note":"Use alias for brevity.","wrong":"","symbol":"WikiText","correct":"import wikitextparser as wtp"},{"note":"Direct import of the parse function.","wrong":"","symbol":"parse","correct":"from wikitextparser import parse"}],"quickstart":{"code":"import wikitextparser as wtp\n\nwikitext = \"\"\"[[Link]]\n== Heading ==\nSome ''italic'' text.\"\"\"\nparsed = wtp.parse(wikitext)\nprint(parsed.templates)  # empty list\nprint(parsed.wikilinks)  # [WikiLink('Link')]","lang":"python","description":"Parse a simple wikitext string and access wikilinks and templates."},"warnings":[{"fix":"Check `len(result.templates) > 0` to see if any templates exist.","message":"The library returns an empty list for `templates` if no template syntax is present. New users often expect `None` instead.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `parse(text, strip_comments=True)` instead of calling `.remove_comments()`.","message":"The `remove_comments` method was deprecated in v0.55 in favor of the `strip_comments` parameter","severity":"deprecated","affected_versions":">=0.55"},{"fix":"Ensure wikitext is well-formed or catch `wikitextparser.ParseError`.","message":"Wikitext with unclosed tags may raise a `ParseError`. The parser expects valid markup.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install wikitextparser`.","cause":"The package is not installed.","error":"ModuleNotFoundError: No module named 'wikitextparser'"},{"fix":"Upgrade to latest version: `pip install --upgrade wikitextparser`.","cause":"Using an outdated version where attributes differed.","error":"AttributeError: 'WikiText' object has no attribute 'templates'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}