Registry / data / mwxml
library0.3.8pypypi✓ verified 84d ago

A set of utilities for processing MediaWiki XML dump data. Currently at version 0.3.8, with irregular releases.

pip install mwxml
INSTALL
IMPORT
SIG · MWXML
M
mwxml
datapythonv0.3.8
Install
3.6s avg
Import
168ms
Disk
22MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.8 · 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.174s · 24.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.6s · import 0.162s · 24MB
22MB installed
● package 22MB
Code
Verified usage

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

Dump
import mwxml
Dump is accessed via mwxml.Dump after importing the module.
Page
from mwxml import Page
Page is only available as mwxml.Page. Some users mistakenly try mwxml.dump.Page.

Opens a MediaWiki XML dump file and iterates over pages and revisions.

import mwxml dump = mwxml.Dump.from_file(open('example.xml', 'rb')) for page in dump.pages: print(page.title) for revision in page.revisions: print(revision.text)
Debug
Known issues
gotchaThe Dump.from_file expects a file opened in binary mode ('rb'), not text mode.
fix
Always open the dump file with open('file.xml', 'rb').
affects: 0.3.x
gotchaRevision.text may be None if the revision has been deleted or suppressed. Always check for None before processing.
fix
Use: if revision.text is not None: process(revision.text)
affects: all
deprecatedThe mwxml.Dump constructor is deprecated in favor of Dump.from_file.
fix
Use mwxml.Dump.from_file() instead of mwxml.Dump().
affects: 0.3.0+
Errors
Common errors & fixes
AttributeError: module 'mwxml' has no attribute 'Dump'
Common installation issue where the package is not installed correctly or version mismatch.
fix
Ensure mwxml is installed (pip install mwxml) and import with import mwxml. Then use mwxml.Dump.
OSError: [Errno 22] Invalid argument
Opening the dump file in text mode instead of binary mode.
fix
Open the file with open('dump.xml', 'rb') (binary mode).
TypeError: cannot use a string pattern on a bytes-like object
Passing a file opened in text mode to Dump.from_file.
fix
Use binary mode: open('dump.xml', 'rb').
Upgrade
Version history
0.3.8latest on PyPI · released Apr 8, 2026
Audit
Dependencies
mwparserfromhelloptionalUsed for parsing wiki text within dump processing.
Agent activity
4 hits · last 30 days
node
4
Resources
mwxml — pip install mwxml · libregistry