Modern CLI utility for extracting structured data from Old School RuneScape Wiki
Project description
osrs-wiki-cli
A modern CLI utility for extracting structured data from the Old School RuneScape Wiki. Built for developers who need clean, programmatically accessible data formats for RuneLite plugins, web applications, and data analysis workflows.
Features
- 🔌 Plugin-Ready Data Formats - JSON and CSV outputs optimized for RuneLite plugins and external tools
- 📊 Structured Data Extraction - Clean API responses suitable for databases and spreadsheet analysis
- 🔍 MediaWiki API Integration - Direct JSON access without HTML parsing dependencies
- 📄 Multiple Output Formats - JSON, CSV, and raw text formats for different integration needs
- 🏗️ Modular Commands - Composable subcommands for specific data extraction tasks
- 🛡️ Developer-Friendly - Rate limiting, error handling, and batch processing support
Quick Start
# Extract Lua module data for plugin development
osrs-wiki-cli source "Module:SlayerConsts/MasterTables" --format json
# Get calculator configurations with dependencies
osrs-wiki-cli source "Calculator:Agility" --templates --format text
# List all items in a category for data analysis
osrs-wiki-cli category "Items" --format csv --limit 50
# Extract template structure for parsing
osrs-wiki-cli source "Template:Infobox Item" --format text
Installation
-
Clone the repository:
git clone https://github.com/cloud-aspect/osrs-wiki-cli.git cd osrs-wiki-cli
-
Install osrs-wiki-cli:
# Option 1: Install from PyPI (recommended) pip install osrs-wiki-cli # Option 2: Install from source python -m venv venv venv\Scripts\activate # Windows # or source venv/bin/activate # Linux/macOS pip install requests beautifulsoup4
Usage
The tool provides commands designed for different integration workflows:
Commands
source- Extract raw source code, templates, and dependencies for custom parsingcategory- Generate complete page lists for building indexes and data catalogspage(planned) - Extract parsed tables and infoboxes in structured formatssearch(planned) - Search wiki content with filtering for targeted data discovery
Integration Examples
# Extract all items for a trading application database
osrs-wiki-cli category "Items" --format csv --save
# Get monster data for combat calculator development
osrs-wiki-cli category "Monsters" --format json --limit 100
# Extract Lua modules for game logic integration
osrs-wiki-cli source "Module:SlayerConsts/MasterTables" --format text
Data Integration Examples
RuneLite Plugin Development
// Using extracted JSON data in a RuneLite plugin
@Slf4j
public class WikiDataPlugin extends Plugin {
private Map<String, ItemInfo> itemDatabase;
@Override
protected void startUp() {
// Load extracted wiki data: python wiki_tool.py category "Items" --format json
itemDatabase = loadWikiItemData("data/categories/Items.json");
log.info("Loaded {} items from wiki extraction", itemDatabase.size());
}
}
Web Application Integration
// Load extracted category data for web app
async function loadGameData() {
// Data from: python wiki_tool.py category "Calculators" --format json --save
const calculators = await fetch('/data/categories/Calculators.json').then(r => r.json());
// Build searchable calculator index
const searchIndex = calculators.pages.map(calc => ({
name: calc.title.replace('Calculator:', ''),
url: calc.title,
lastUpdated: calc.timestamp
}));
return { calculators: searchIndex };
}
Database Loading
# Load extracted CSV data into pandas/SQLite
import pandas as pd
import sqlite3
# Load data from: osrs-wiki-cli category "Items" --format csv --save
df = pd.read_csv('data/categories/Items.csv')
# Create searchable database
conn = sqlite3.connect('osrs_data.db')
df.to_sql('wiki_items', conn, if_exists='replace', index=False)
# Query for item lookup
items = pd.read_sql("SELECT * FROM wiki_items WHERE title LIKE '%sword%'", conn)
print(f"Found {len(items)} sword items")
For detailed usage instructions, see the User Guide.
Documentation
- User Guide - Complete usage instructions and examples
- API Reference - Command-line interface documentation
- Developer Guide - Contributing and development setup
- Data Examples - Sample outputs and use cases
Project Background
This tool provides developers and data analysts with programmatic access to the OSRS Wiki's extensive structured content, including:
- Lua Modules: Complete game logic and data tables for plugin integration
- Calculator Configurations: JavaScript and template-based calculators with parameters
- Category Systems: Comprehensive lists for building complete datasets
- Template Structures: Underlying data formats for custom parsing solutions
The extracted data formats are designed for seamless integration into RuneLite plugins, web applications, mobile apps, databases, and custom analysis tools.
Contributing
We welcome contributions! Please see our Contributing Guide for details on:
- Setting up the development environment
- Code style and standards
- Submitting pull requests
- Reporting issues
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Old School RuneScape Wiki for providing comprehensive game data
- MediaWiki API for reliable programmatic access
- The OSRS community for maintaining accurate wiki content
Related Projects
- sqlite-utils - CLI tool and library for SQLite databases
- osrs-cli - Command line tools for OSRS calculations
- RuneLite - Open source OSRS client with extensive APIs
Need help? Check out the FAQ or open an issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osrs_wiki_cli-1.0.0.tar.gz.
File metadata
- Download URL: osrs_wiki_cli-1.0.0.tar.gz
- Upload date:
- Size: 30.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ffcfe84f3a9fa832ca41932899ec0bfda504bd17e99cb9816a4138f62557917
|
|
| MD5 |
e101103c41df3ec85fd0cbe9c49574b8
|
|
| BLAKE2b-256 |
e4b5f7115fdb482b8a745ba6d6af4307095fd31bdabbd2bcb5968d5f35668498
|
Provenance
The following attestation bundles were made for osrs_wiki_cli-1.0.0.tar.gz:
Publisher:
publish.yml on cloud-aspect/osrs-wiki-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osrs_wiki_cli-1.0.0.tar.gz -
Subject digest:
3ffcfe84f3a9fa832ca41932899ec0bfda504bd17e99cb9816a4138f62557917 - Sigstore transparency entry: 602124719
- Sigstore integration time:
-
Permalink:
cloud-aspect/osrs-wiki-cli@be48082fb0027c7d592a1b9da92f7b0c46a4233e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cloud-aspect
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be48082fb0027c7d592a1b9da92f7b0c46a4233e -
Trigger Event:
push
-
Statement type:
File details
Details for the file osrs_wiki_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: osrs_wiki_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2a7931e088b270bd6e692e4e01b00a4687c1c3dc18c2d228d0f19562021fccb
|
|
| MD5 |
fd0543fc6995c512db7370a00fc4d038
|
|
| BLAKE2b-256 |
8c15a7051a756f0309a76cb3283c34684ea818b5a4e34634a0e3b73777f4b3c0
|
Provenance
The following attestation bundles were made for osrs_wiki_cli-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on cloud-aspect/osrs-wiki-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osrs_wiki_cli-1.0.0-py3-none-any.whl -
Subject digest:
a2a7931e088b270bd6e692e4e01b00a4687c1c3dc18c2d228d0f19562021fccb - Sigstore transparency entry: 602124722
- Sigstore integration time:
-
Permalink:
cloud-aspect/osrs-wiki-cli@be48082fb0027c7d592a1b9da92f7b0c46a4233e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cloud-aspect
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be48082fb0027c7d592a1b9da92f7b0c46a4233e -
Trigger Event:
push
-
Statement type: