✦ Pure Python 3 Stdlib · Zero Dependencies · CC0 Public Domain

MediaWiki XML Export Unpacker

Drag and drop an exported mediawiki.xml (or .xml.gz / .xml.bz2) onto mediawiki_export_unpacker.py to unpack every article into standalone, cross-linked UTF-8 HTML + clean UTF-8 plain text (.txt) + dedicated King Jim Pomera DM30 (pomera/) files + a searchable offline index.html.

↓ Download mediawiki_export_unpacker.py (v1.0.3) View Source & Tests on GitLab

★ Drag & Drop Ready

Drop your .xml onto the .py icon in Windows Explorer (or double-click it to pick an XML file in the same folder). Output writes right next to your XML inside <name>_export/.

✦ Japanese & Swedish Unicode

Full UTF-8 + canonical NFC normalization for 日本語 (kanji, kana, {{nihongo}}, {{ruby}}, カテゴリ:, #転送) and Svenska (åäö / ÅÄÖ, link trails like [[ö]]arna, Kategori:, #OMDIRIGERING).

◆ Clean HTML + Plain TXT

Two-pass streaming ElementTree parser keeps RAM tiny even on large dumps while resolving internal [[WikiLinks]], tables, infoboxes, lists, and <ref> footnotes.

■ Pomera DM30 Ready

Exports a dedicated pomera/ folder in native Shift_JIS (cp932) with . / .. / ... Outline Mode TOC headings (Ctrl+F1), DM30-safe filenames, and 50k-char auto-splitting.

Quick Usage

# Option 1 (Windows Explorer):
# Just drag & drop mediawiki.xml onto mediawiki_export_unpacker.py!

# Option 2 (Command Line — Windows / macOS / Linux):
python mediawiki_export_unpacker.py mediawiki.xml

# Optional flags:
#   --main-only       Export only main-namespace articles (ns=0)
#   --skip-redirects  Skip writing separate files for #REDIRECT pages
#   -o my_folder      Write output into a custom folder

Output Folder Structure

mediawiki_export/
├── index.html          # Instant offline search (English / 日本語 / Svenska)
├── _manifest.txt       # Complete UTF-8 list of exported titles & paths
├── html/
│   ├── 風の谷のナウシカ.html
│   └── Göteborgs skärgård.html
├── txt/
│   ├── 風の谷のナウシカ.txt
│   └── Göteborgs skärgård.txt
└── pomera/                 # King Jim Pomera DM30 (Shift_JIS + '.' Outline TOC)
    ├── _index.txt
    ├── 風の谷のナウシカ.txt
    └── Goteborgs skargard.txt