A modern asynchronous client for the Wizard101 Wiki.
Project description
WizWiki v0.1.4
A modern, high-performance, asynchronous Python library designed to scrape and query the Wizard101 Wiki with precision and ease for python 3.11+.
Features
- 🚀 Asynchronous API: Fully non-blocking I/O using
asyncio, ensuring your applications remain responsive. - 🛡️ Cloudflare Bypass: Integrated with
cloudscraperto seamlessly navigate through Wiki protection. - 🏗️ Structured Models: Powered by Pydantic V2, providing rigorous type validation and excellent IDE support.
- 💧 Lazy Loading: Thin "View" models for quick index browsing that can be promoted to full "Resource" objects on-demand.
- ⚔️ Battle Insights: Detailed parsing of Creature battle stats, including pips, boosts, and resistances.
- 📦 Categorized Drops: Automatically groups gear, spells, and reagents into searchable dictionaries.
Architecture: View & Resource Models
WizWiki uses a specialized dual-model system to maintain high performance and low memory overhead:
- View Models (
View): When a resource is returned as part of a collection (e.g., an item dropped by a boss), it is instantiated as a lightweightViewobject (likeItemView). These objects contain only basic identification data (name, category, url) and do not fetch the full wiki page immediately. - Resource Models (
Resource): These are the full-fidelity objects (likeItem,Creature,Spell). They contain all extracted fields and detailed information. - Lazy Promotion: You can "promote" any
Viewinto a fullResourceby calling awaiting its.get()method. This seamlessly triggers a web request to parse the full page only when you explicitly need the data.
Under The Hood
- Engine (
cloudscraper): Many components of the Wiki are protected by Cloudflare. WizWiki usescloudscraperto handle these challenges automatically, wrapping them in an asynchronous execution layer to prevent event-loop blocking. - Parsing (
BeautifulSoup4): We use specialized heuristics to parse the Wiki's complex HTML structure. Our parsing logic is encapsulated within the models themselves, allowing for specialized extraction of stats, locations, and drops. - Data Integrity (
Pydantic): Every piece of data is validated against strict schemas. This means you get a consistent API and predictable objects every time you query a resource.
Installation
pip install wizwiki
Quick Start
import asyncio
from wizwiki import WizWikiClient
async def main():
client = WizWikiClient()
# Fetch a creature (and its minions)
creature = await client.get_creature("Malistaire Drake")
print(f"Name: {creature.name} (Health: {creature.health})")
# Access structured Battle Stats
stats = creature.battle_stats
print(f"Starting Pips: {stats.starting_pips}")
print(f"Resistances: {stats.incoming_resist}")
# Promote a dropped item 'View' to a full 'Resource'
if "Hats" in creature.drops:
hat_view = creature.drops["Hats"][0]
hat = await hat_view.get() # Unified lazy loading
print(f"Full Item Detail: {hat.name}")
if __name__ == "__main__":
asyncio.run(main())
Supported Categories
- Creatures: Stats, Drops, Locations, and Minions.
- Spells: School, Accuracy, and Effect parsing.
- Items: Gear, Decks, and Wands.
- Reagents, Jewels, & Housing: Full resource identification.
CI/CD & Quality
WizWiki is tested across Ubuntu, Windows, and macOS using tox and GitHub Actions, ensuring compatibility across Python 3.11, and 3.12.
License
This project is licensed under the MIT License.
Project details
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 wizwiki-0.1.4.tar.gz.
File metadata
- Download URL: wizwiki-0.1.4.tar.gz
- Upload date:
- Size: 24.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 |
462224a1a4858e27c570c3c94ce036159e3752021280f49013c2a2d4932b857c
|
|
| MD5 |
422f26ceb8c348a317d76d1995b078a3
|
|
| BLAKE2b-256 |
fa452b6d29d592a0d03778bd9bcd4bd4db0b1a52f2a736d2d4ed5d1978ca58d5
|
Provenance
The following attestation bundles were made for wizwiki-0.1.4.tar.gz:
Publisher:
publish.yml on Angle-Brackets/WizWiki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wizwiki-0.1.4.tar.gz -
Subject digest:
462224a1a4858e27c570c3c94ce036159e3752021280f49013c2a2d4932b857c - Sigstore transparency entry: 1108454594
- Sigstore integration time:
-
Permalink:
Angle-Brackets/WizWiki@f3beee21a22b3d2e33c4861b8b84e8c33f545045 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Angle-Brackets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f3beee21a22b3d2e33c4861b8b84e8c33f545045 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wizwiki-0.1.4-py3-none-any.whl.
File metadata
- Download URL: wizwiki-0.1.4-py3-none-any.whl
- Upload date:
- Size: 25.5 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 |
054b612aac33d1f9eb6b45b99b25e313f3bd0059c3e3571400e36bfffd9eb288
|
|
| MD5 |
5c141ebfee7a0bf84db7e9b2ced51ea5
|
|
| BLAKE2b-256 |
2321d61d51fa42f83b50c0c528f009922a233a3273d0495cbfab25cf2ce2283d
|
Provenance
The following attestation bundles were made for wizwiki-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on Angle-Brackets/WizWiki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wizwiki-0.1.4-py3-none-any.whl -
Subject digest:
054b612aac33d1f9eb6b45b99b25e313f3bd0059c3e3571400e36bfffd9eb288 - Sigstore transparency entry: 1108454596
- Sigstore integration time:
-
Permalink:
Angle-Brackets/WizWiki@f3beee21a22b3d2e33c4861b8b84e8c33f545045 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Angle-Brackets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f3beee21a22b3d2e33c4861b8b84e8c33f545045 -
Trigger Event:
push
-
Statement type: