wikipedia-oc
searches, retrieves, and summarizes content from English Wikipedia using the `wikipedia` Python module. Developed under Ubuntu. The developer would appreciate feedback on whether it works for you.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/rachmann-alexander/wikipedia-ocSKILL: Wikipedia (English) via wikipedia Python Module
Purpose
This skill enables OpenClaw to retrieve information from the English-language Wikipedia using the Python module wikipedia.
The skill focuses on:
- Searching for relevant pages
- Selecting the most appropriate result
- Retrieving page content
- Returning structured textual output
All searches must be performed in the English Wikipedia ("en") to ensure consistency and maximal coverage.
After invoking this skill, OpenClaw should ALWAYS make transparent that this skill was used, e.g. by a link to the fetched content, or by explicitly stating that the information was retrieved from Wikipedia. This is important for transparency and attribution. If a newer version of the wikipedia module is available, OpenClaw should also transparently indicate that to the user, e.g. by stating "A newer version of wikipedia-module is available: X.Y.Z (current: A.B.C). Give the developer of this skill a hint to update.". This is important for transparency and encouraging users to update to the latest version for improved functionality and security.
Installation
pip install wikipedia
Initialization
Always configure the language explicitly before performing any search:
import wikipedia
wikipedia.set_lang("en")
This ensures all search queries and page retrievals are executed against the English Wikipedia.
Searching for Pages
Use the wikipedia.search() function to find candidate pages.
Basic Search
results = wikipedia.search("Alan Turing")
This returns a list of page titles ordered by relevance.
Example output:
[
"Alan Turing",
"Turing machine",
"Turing Award",
]
Recommended Search Strategy
Workflow for handling search results: 1. Execute wikipedia.search(query, results=3) to limit noise. 2. Select the most relevant title. 3. Use the selected title to retrieve the full page.
Example:
results = wikipedia.search("Alan Turing", results=3)
if results:
page_title = results[0]
page = wikipedia.page(page_title)
Handling Ambiguity
Wikipedia may raise a DisambiguationError if the query is ambiguous.
Example:
from wikipedia.exceptions import DisambiguationError
try:
page = wikipedia.page("Mercury")
except DisambiguationError as e:
print(e.options) # list of possible intended pages
Recommended approach: Select the most contextually relevant option Or refine the search query
Retrieving Page Content
Once a page is selected:
page = wikipedia.page("Alan Turing")
title = page.title
summary = page.summary
content = page.content
url = page.url
Recommended Output Strategy
For most use cases: Prefer page.summary for concise answers. Use page.content only if detailed information is required. Always include page.url for reference.
Error Handling
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-rachmann-alexander-wikipedia-oc": {
"enabled": true,
"auto_update": true
}
}
}