wikimedia-wikitext

Parse and manipulate MediaWiki wikitext templates, tables, and citations.

15|6|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/fuzheado/Wikipedia-AI-Skills --skill wikimedia-wikitext
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wikimedia-wikitext
Source: https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikimedia-wikitext
Command: npx skills add https://github.com/fuzheado/Wikipedia-AI-Skills --skill wikimedia-wikitext

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mwparserfromhell, requests, beautifulsoup4, lxml, pandas, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill simplifies parsing and manipulating Wikipedia and MediaWiki wikitext, providing accurate and efficient extraction of structured data from templates, tables, and citations.

Core Features & Use Cases

  • AST Parsing: Utilizes mwparserfromhell for robust parsing of wikitext, avoiding regex pitfalls.
  • Parsoid HTML Strategy: Offers a method to read page content as structured text/data, using MediaWiki's REST API and BeautifulSoup/lxml.
  • Template Manipulation: Extracts and manipulates template parameters safely.
  • Data Extraction: Extracts tables, links, and citations from wikitext.
  • Use Case: Use this Skill to quickly extract structured data from Wikipedia pages, or to process wikitext for automated tasks.

Quick Start

Use the parse_wikitext.py script with the following command to extract all templates from a wikitext file:

python3 assets/parse-wikitext.py page.wikitext --templates

Frequently Asked Questions about wikimedia-wikitext

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract structured data from Wikipedia templates without using regex?

You can extract structured data from Wikipedia templates by parsing wikitext into an AST using mwparserfromhell. This approach avoids regex pitfalls and allows safe extraction and manipulation of template parameters.

What's the best way to parse MediaWiki wikitext tables and citations?

The best way to parse MediaWiki wikitext tables and citations is using a dedicated wikitext parser like mwparserfromhell to build an AST, or fetching structured HTML via the MediaWiki REST API and parsing it with BeautifulSoup and lxml.

Does mwparserfromhell work with BeautifulSoup for extracting wikitext data?

Yes, mwparserfromhell works alongside BeautifulSoup. You can use mwparserfromhell for direct wikitext AST parsing and template manipulation, while BeautifulSoup handles HTML structured data retrieved from the MediaWiki REST API.

How do I get structured text from Wikipedia pages via the MediaWiki REST API?

You get structured text from Wikipedia pages by requesting page content through the MediaWiki REST API and parsing the returned HTML. Using BeautifulSoup and lxml extracts structured data efficiently without dealing with raw wikitext syntax.

Why should I use AST parsing instead of regex for wikitext template manipulation?

AST parsing is preferred over regex for wikitext template manipulation because it accurately handles nested structures and complex syntax. Parsing the wikitext AST ensures safe parameter extraction and modification without breaking fragile template formatting.

Can I extract data from MediaWiki wikitext for automated processing tasks?

Yes, you can extract data from MediaWiki wikitext for automated processing. By parsing templates, tables, links, and citations into structured formats, the extracted data can be directly integrated into pandas DataFrames or other automated workflows.