Python API¶
The Python surface is a single stable-ABI extension, wowlib, built with
nanobind and bound automatically by welder from the annotated C++ headers. These
pages are generated by mkdocstrings from the extension's .pyi stub tree —
the same typed surface your editor and mypy see — so signatures, overloads and
docstrings here match what you import.
Package layout¶
| Module | Contents |
|---|---|
wowlib |
Core vocabulary: ClientVersion, Expansion, Locale, file keys, exceptions |
wowlib.versions |
One ClientVersion constant per finished expansion (versions.wotlk, …) |
wowlib.fs |
The filesystem gateway over MPQ / CASC storages |
wowlib.formats |
The chunk framework's shared payload types (StringBlock, ChunkBlob) and the format subpackages |
wowlib.formats.common |
Shared wire primitives — vectors, matrices, colours, planes |
wowlib.formats.wmo |
The WMO format — root & group, per-expansion classes |
wowlib.formats.m2 |
The M2 model format — body, skins, skeletons and satellites |
wowlib.formats.wdt |
The WDT map description — main file + _occ/_lgt/_fogs/_mpv satellites |
wowlib.formats.wdl |
The WDL low-resolution heightmap |
wowlib.formats.adt |
The ADT terrain tile — heights, textures, liquids, placements, unified across split files |
wowlib.formats.blp |
The BLP texture format — decode to/encode from RGBA |
wowlib.db |
Client databases (DBFilesClient/) — LocString, encryption vocabulary |
wowlib.db.tables |
Typed per-era table modules (tables.wotlk.Map(), … one submodule per expansion) |
| containers | Opaque Vector* types — by-reference, zero-copy NumPy |
Types are shipped
wowlib installs a PEP 561 wowlib-stubs package, so mypy and IDEs pick
up the full typed surface with no extra configuration.
Installing
The distribution iswowlib-py; the module you import is wowlib.
They differ because the wowlib name on PyPI belongs to an unrelated
project abandoned in 2018. Wheels are stable-ABI (CPython ≥ 3.13) and carry
the compiled extension, so no C++ toolchain is needed to install.