Registry / data / wikitextparser

wikitextparser

JSON →
library1.0.1pypypi✓ verified 85d ago

A simple parsing tool for MediaWiki's wikitext markup. Current version: 0.56.4. Releases follow no fixed cadence.

pip install wikitextparser
INSTALL
IMPORT
SIG · WIKITEXTPARSER
W
wikitextparser
datapythonv1.0.1
Install
2.5s avg
Import
338ms
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.352s · 27.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.324s · 29MB
24MB installed
● package 24MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WikiText
import wikitextparser as wtp
Use alias for brevity.
parse
from wikitextparser import parse
Direct import of the parse function.

Parse a simple wikitext string and access wikilinks and templates.

import wikitextparser as wtp wikitext = """[[Link]] == Heading == Some ''italic'' text.""" parsed = wtp.parse(wikitext) print(parsed.templates) # empty list print(parsed.wikilinks) # [WikiLink('Link')]
Debug
Known issues
gotchaThe library returns an empty list for `templates` if no template syntax is present. New users often expect `None` instead.
fix
Check `len(result.templates) > 0` to see if any templates exist.
affects: all
deprecatedThe `remove_comments` method was deprecated in v0.55 in favor of the `strip_comments` parameter
fix
Use `parse(text, strip_comments=True)` instead of calling `.remove_comments()`.
affects: >=0.55
gotchaWikitext with unclosed tags may raise a `ParseError`. The parser expects valid markup.
fix
Ensure wikitext is well-formed or catch `wikitextparser.ParseError`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'wikitextparser'
The package is not installed.
fix
Run `pip install wikitextparser`.
AttributeError: 'WikiText' object has no attribute 'templates'
Using an outdated version where attributes differed.
fix
Upgrade to latest version: `pip install --upgrade wikitextparser`.
Upgrade
Version history
1.0.1latest on PyPI · released Jun 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
42 hits · last 30 days
node
34
OpenAI (training)
1
Resources
wikitextparser — pip install wikitextparser · libregistry