--- id: wikitextparser version: "1.0.3" license: GNU General Public License v3 (GPLv3) license_treatment: copyleft maintenance: active --- # wikitextparser — A simple parsing tool for MediaWiki's wikitext markup. License: copyleft · Maintenance: active · Downloads: 127.2K/mo ## What it is and what it does WikiTextParser is a library for parsing and manipulating MediaWiki's wikitext syntax. It lets you extract structured elements—templates, parameters, wikilinks, tables, sections, lists, and HTML tags—from raw wiki markup and modify them programmatically. The library handles nested templates, colspan/rowspan in tables, category detection, and section hierarchy, making it suitable for bulk editing, data extraction, or automated wiki maintenance tasks. The package depends on regex and wcwidth for pattern matching and text width calculation. It is actively maintained, supports modern Python versions (3.8+), and has no known security vulnerabilities. The GPLv3 license means any code using it must also be open-source under the same license. Use it for: - Extract template arguments and parameter values from Wikipedia or MediaWiki dumps for data analysis. - Bulk clean up or refactor wiki markup—remove duplicate template arguments, rename sections, or update wikilinks. - Parse and validate wikitext structure before uploading edits to a wiki via API. - Build wiki bots that read, modify, and rewrite wikitext without corrupting nested markup. - Convert or normalize wiki markup (e.g., change list types or reformat table structure). ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and manipulates MediaWiki wikitext markup, extracting and modifying templates, wikilinks, tables, sections, lists, and other wiki elements programmatically. Yes. The package is actively maintained, has low install friction, no security issues, and fills a specific need for MediaWiki wikitext parsing. The GPLv3 copyleft license is a hard constraint only if you need proprietary distribution; for open-source projects, wiki automation, or data extraction, it is a straightforward choice. ## Install pip install wikitextparser uv add wikitextparser poetry add wikitextparser ## Installing wikitextparser Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (14 days ago) and steady commit activity. Two lightweight runtime dependencies (regex and wcwidth) add minimal overhead. License in practice: Licensed under GPLv3 (copyleft). Any derivative work or distribution must also be open-source under GPLv3; proprietary applications cannot incorporate this code without releasing their own source. Quickstart: pip install wikitextparser import wikitextparser as wtp parsed = wtp.parse('{{template|arg=value}}') print(parsed.templates) Requires Python 3.8 or later. Verify before relying: - Whether the library handles all edge cases and malformed HTML robustly (documentation notes it is not a fully-fledged HTML parser). - Performance characteristics on very large wikitext documents or deeply nested template structures. ## Package facts - License: GNU General Public License v3 (GPLv3) (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 127.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags mediawiki wikitext parser, extract templates from wiki markup, parse wikitext python, wiki markup manipulation, wikilink extraction, mediawiki template parser, wikitext section extraction, mediawiki, wiki-automation, markup-parsing [View on SkillFed](https://skillfed.io/packages/wikitextparser) · [View on PyPI](https://pypi.org/project/wikitextparser/)