dk-wikibot
Fetch, search, and extract information from Wikipedia, Wikidata, or any MediaWiki-based wiki using pywikibot.
Skill by dushyantkhosla
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/dushyantkhosla-dk-wikibot
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/dk-wikibot
What's inside
- Skill name
dk-wikibot- Description
- Fetch, search, and extract information from Wikipedia, Wikidata, or any MediaWiki-based wiki using pywikibot. Use when the user asks to scrape Wikipedia articles or infoboxes, iterate over Wikipedia categories, query Wikidata entities and claims (structured facts), look up award winners, historical lists, or biographical data from Wikimedia projects. Also triggers on phrases like "use the wikibot skill", "look up on Wikipedia", or "query Wikidata". Does not handle live web searches, non-Wikimedia sites, or tasks requiring a logged-in Wikipedia account.
- License
- Apache-2.0
- Compatibility
- Requires Python 3.8+, pywikibot, mwparserfromhell (uv add pywikibot mwparserfromhell). Read-only tasks require no credentials.
- Metadata
- author: dushyantkhosla · version: 1.0 · opencode/autoinvoke: false
- Instructions
- 195 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- api.md · references/
SKILL.md (first lines)
# Pywikibot Skill
Pywikibot wraps the MediaWiki API. For **read-only** tasks (the common case), no credentials are
needed — set `PYWIKIBOT_NO_USER_CONFIG=1`.
Always write a standalone Python script and execute it via `bash_tool`. Do not import pywikibot
interactively — it makes blocking network calls and must run as a script.
## Setup
```bash
uv add pywikibot mwparserfromhell
export PYWIKIBOT_NO_USER_CONFIG=1
```
Every script must start with:
```python
import os; os.environ['PYWIKIBOT_NO_USER_CONFIG'] = '1'
import pywikibot
```
---
## Step-by-step instructions
### 1. Fetch a Wikipedia article
```python
import os; os.environ['PYWIKIBOT_NO_USER_CONFIG'] = '1'
import pywikibot
site = pywikibot.Site('en', 'wikipedia')
page = pywikibot.Page(site, 'Grammy Award for Best Rock Song')
print(page.text[:3000]) # raw wikitext — inspect this first before parsing
```
Always inspect `page.text` before writing any parser. Wikitext structure varies per article.
### 2. Parse wikitext
```python
import mwparserfromhell
wikicode = mwparserfromhell.parse(page.text)
templates = wikicode.filter_templates() # e.g. {{won}}, {{nom}}, {{infobox}}
```
Alternatively, use regex directly on `page.text`:
```python
import re
year_sections = re.split(r'\n==\s*(\d{4})\s*==\n', page.text)
links = re.findall(r'\[\[([^\|\]]+)(?:\|[^\]]+)?\]\]', block)
```
### 3. Iterate a Wikipedia category
```python
import os; os.environ['PYWIKIBOT_NO_USER_CONFIG'] = '1'
import pywikibot
site = pywikibot.Site('en', 'wikipedia')
cat = pywikibot.Category(site, 'Category:Grammy Award for Best Rock Song')
for page in cat.articles(total=50):
print(page.title())
```
Use `cat.subcategories()` for subcats, `cat.members()` for everything.
### 4. Query Wikidata via SPARQL
Best for clean structured data (winners, dates, relationships). Find the QID for any entity at
https://www.wikidata.org/wiki/Special:Search first, then use it in the query.
```python
import os; os.environ['PYWIKIBOT_NO_USER_CONFIG'] = '1'
from pywikibot.data import sparql
QUERY = """
SELECT ?year ?songLabel ?artistLabel WHERE {
?award wdt:P31 wd:Q1377714 . # instance of Grammy Award for Best Rock Song
?award wdt:P585 ?date .
BIND(YEAR(?date) AS ?year)
FILTER(?year >= 2010)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?year
"""
results = sparql.SparqlQuery().select(QUERY)
for row in results:
print(row)
```
### 5. Fetch a Wikidata item directly
```python
import os; os.environ['PYWIKIBOT_NO_USER_CONFIG'] = '1'
import pywikibot
site = pywikibot.Site('en', 'wikipedia')
page = pywikibot.Page(site, 'Douglas Adams')
item = pywikibot.ItemPage.fromPage(page)
item.get()
print(item.labels.get('en'))
print(item.claims) # dict of property_id -> list of Claims
```
---
## Decision guide
| Task | Approach |
|------|----------|
| Award winner lists, formatted tables | Wikipedia `page.text` + wikitext parsing |
| Clean structured facts (dates, IDs, relationships) | Wikidata SPARQL or `ItemPage` |
| Category membership | `Category.articles()` |
| Multiple entities at once | Wikidata SPARQL (most efficient) |
---From dushyantkhosla/agent-skills, Apache-2.0.
More from dushyantkhosla/agent-skills
- 0.570score
dk-wiki-article-writing
dushyantkhosla
Use when writing a Wikipedia-style article or comprehensive research-backed document on a technical topic.
SkillAFreshness: AClaude Code +9 - 0.570score
dk-lm-studio-pydantic-ai
opencode
Use LM Studio as a local LLM backend with Pydantic AI for structured output extraction.
SkillAFreshness: AClaude Code +9 - 0.566score
dk-transcribe-summarize
dushyantkhosla
Transcribe audio files or YouTube videos via subtitles or OpenRouter's multimodal API, generate 100-word and 400-word summaries using cloud models…
SkillAFreshness: AClaude Code +9 - 0.565score
here-now
dushyantkhosla
here.now lets agents publish websites and files to live URLs in seconds.
SkillAFreshness: AClaude Code +9 - 0.559score
browser-tools
dushyantkhosla
Browser automation over Chrome DevTools Protocol on port 9222 — navigate, evaluate JavaScript, take screenshots, and extract readable article content as…
SkillAFreshness: AClaude Code +9 - 0.553score
caveman
dushyantkhosla
Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy.
SkillAFreshness: AClaude Code +9 - 0.531score
improve-codebase-architecture
dushyantkhosla
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
SkillAFreshness: AClaude Code +9 - 0.531score
sdd-brainstorming
dushyantkhosla
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior.
SkillAFreshness: AClaude Code +9 - 0.523score
handoff
dushyantkhosla
Compact the current conversation into a handoff document for another agent to pick up.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Oct 7, 2026 (20 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- Apache-2.0
- Repository
- github.com/dushyantkhosla/agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from dushyantkhosla
- 0.570score
dk-wiki-article-writing
dushyantkhosla
Use when writing a Wikipedia-style article or comprehensive research-backed document on a technical topic.
SkillAFreshness: AClaude Code +9 - 0.566score
dk-transcribe-summarize
dushyantkhosla
Transcribe audio files or YouTube videos via subtitles or OpenRouter's multimodal API, generate 100-word and 400-word summaries using cloud models…
SkillAFreshness: AClaude Code +9 - 0.565score
here-now
dushyantkhosla
here.now lets agents publish websites and files to live URLs in seconds.
SkillAFreshness: AClaude Code +9 - 0.559score
browser-tools
dushyantkhosla
Browser automation over Chrome DevTools Protocol on port 9222 — navigate, evaluate JavaScript, take screenshots, and extract readable article content as…
SkillAFreshness: AClaude Code +9 - 0.553score
caveman
dushyantkhosla
Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy.
SkillAFreshness: AClaude Code +9 - 0.531score
sdd-brainstorming
dushyantkhosla
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior.
SkillAFreshness: AClaude Code +9
Cite this page
dk-wikibot skill. Agent Mart. https://agentmart.dev/skills/dushyantkhosla-dk-wikibot (last updated 2026-10-24)