Skip to content

Core & versions

The top-level wowlib module holds the shared vocabulary — client versions and expansions, locales, file keys, and the exception hierarchy — used across the filesystem and format layers.

Reading and writing World of Warcraft client files: client filesystem access (MPQ and CASC), listfile databases, and a project-directory overlay for modding.

StorageKind

Bases: IntEnum

Which storage technology a client generation uses: Mpq for pre-WoD retail clients (StormLib), Casc for WoD+ and every Classic client (CascLib).

Mpq class-attribute instance-attribute

Mpq = 0

Casc class-attribute instance-attribute

Casc = 1

ClientFlavor

Bases: IntEnum

Which product line a client belongs to. Retail is the ordinary progression client, where the version number also tells you the engine generation. Every other flavor is a MODERN-engine client wearing a legacy version number: WoW Classic Era 1.15.9 is a Midnight-era client, Cataclysm Classic 4.4.2 a War Within-era one. Their file formats follow the build number, not the version tuple — see ClientVersion.format_lineage.

The enumerator also names the client's default TACT product code ('wow', 'wow_classic', 'wow_classic_era', 'wow_anniversary'); products outside these four (PTR, beta, 'wow_classic_titan') pick the closest flavor and pass their exact code to the filesystem explicitly.

Retail class-attribute instance-attribute

Retail = 0

Classic class-attribute instance-attribute

Classic = 1

ClassicEra class-attribute instance-attribute

ClassicEra = 2

Anniversary class-attribute instance-attribute

Anniversary = 3

ClientVersion

ClientVersion()
ClientVersion(major: int = 0, minor: int = 0, patch: int = 0, build: int = 0, flavor: ClientFlavor | None = ...)

A full client version tuple (major.minor.patch, build) plus the product flavor it came from. Determines which storage backend and archive chain a client uses, and — through format_lineage — which engine generation its files are laid out for. The versions namespace provides constants for the releases wowlib targets.

The version tuple alone does NOT identify an engine: the Classic products reuse legacy version numbers on top of whatever retail branch was current when they were built (Classic 3.4.x spans three retail generations; 'wow_classic_titan' calls itself 3.80). The BUILD number does — Blizzard's build counter is global across every product — so every format decision keys on format_lineage, never on major/minor.

major property writable

major: Annotated[int, uint16]

Expansion number, e.g. 3 for Wrath of the Lich King.

minor property writable

minor: Annotated[int, uint16]

Minor version within the expansion.

patch property writable

patch: Annotated[int, uint16]

Patch version within the minor release.

build property writable

build: Annotated[int, uint32]

Exact client build number, e.g. 12340 for 3.3.5a. Unique and monotonic across ALL products, which is what makes it the only reliable engine-generation key.

flavor property writable

flavor: ClientFlavor

Which product line this client is — Retail unless stated.

is_classic property

is_classic: bool

Whether this is a Classic-family client: a modern engine wearing a legacy version number.

storage_kind property

storage_kind: StorageKind

Which storage technology this client uses: Mpq for pre-WoD (< 6.0) retail clients, Casc for everything else — every Classic client is CASC no matter what its version says.

format_lineage property

format_lineage: ClientVersion

The RETAIL release whose file formats this client's files follow — the version every format decision is actually made against.

For a retail client this is the version itself. For a Classic client it is the retail branch that was the live client when this build was produced, looked up by build number: Classic branches fork off the current retail engine, so Cataclysm Classic 4.4.2 (build 60895) lays its files out like The War Within, not like Cataclysm. Builds newer than the newest release wowlib models clamp to it.

default_casc_product property

default_casc_product: str

The TACT product code this flavor installs under by default ('wow', 'wow_classic', 'wow_classic_era', 'wow_anniversary'). PTR, beta and one-off products carry their own code — pass it to the filesystem explicitly.

Locale

Bases: IntEnum

Game client locale; enumerators use the client's own four-letter codes.

enUS class-attribute instance-attribute

enUS = 0

enGB class-attribute instance-attribute

enGB = 1

deDE class-attribute instance-attribute

deDE = 2

frFR class-attribute instance-attribute

frFR = 3

ruRU class-attribute instance-attribute

ruRU = 4

esES class-attribute instance-attribute

esES = 5

esMX class-attribute instance-attribute

esMX = 6

koKR class-attribute instance-attribute

koKR = 7

zhCN class-attribute instance-attribute

zhCN = 8

zhTW class-attribute instance-attribute

zhTW = 9

ptBR class-attribute instance-attribute

ptBR = 10

itIT class-attribute instance-attribute

itIT = 11

Expansion

Bases: IntEnum

The expansion a client belongs to, in release order. The enumerable counterpart of a full ClientVersion: versioned format classes and factories are keyed on it (each enumerator maps to the last-minor-of-major release in the versions namespace).

Vanilla class-attribute instance-attribute

Vanilla = 0

Tbc class-attribute instance-attribute

Tbc = 1

Wotlk class-attribute instance-attribute

Wotlk = 2

Cata class-attribute instance-attribute

Cata = 3

Mop class-attribute instance-attribute

Mop = 4

Wod class-attribute instance-attribute

Wod = 5

Legion class-attribute instance-attribute

Legion = 6

Bfa class-attribute instance-attribute

Bfa = 7

Shadowlands class-attribute instance-attribute

Shadowlands = 8

Dragonflight class-attribute instance-attribute

Dragonflight = 9

TheWarWithin class-attribute instance-attribute

TheWarWithin = 10

FileDataID

FileDataID()
FileDataID(value: int = 0)

A strongly-typed FileDataID — the numeric file identifier used by CASC-era clients (u32, matching the client's root manifest and DB2 references).

value property writable

value: Annotated[int, uint32]

The raw numeric identifier.

FileKey

FileKey()
FileKey(file_path: str)
FileKey(file_id: FileDataID)
FileKey(file_path: str, file_id: FileDataID)

A file request: by client-internal path, by FileDataID, or both. The generic file identity for version-independent tools — code that handles any client generation operates on FileKeys without caring which half is available (on pre-CASC clients the FileDataID is simply absent); the storage backend uses the half it needs and FileSystem.resolve fills gaps through the listfile. The stored path is always in canonical form.

fdid property writable

fdid: FileDataID | None

The numeric identifier, if known.

path property writable

path: str | None

The canonical client-internal path, if known.

ArrayC2Vectorx2

ArrayC2Vectorx2()
ArrayC2Vectorx2(arg: list[C2Vector])
ArrayC2Vectorx2(arg: Iterable[C2Vector])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayC3Vectorx3

ArrayC3Vectorx3()
ArrayC3Vectorx3(arg: list[C3Vector])
ArrayC3Vectorx3(arg: Iterable[C3Vector])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayC3Vectorx4

ArrayC3Vectorx4()
ArrayC3Vectorx4(arg: list[C3Vector])
ArrayC3Vectorx4(arg: Iterable[C3Vector])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayC4Planex6

ArrayC4Planex6()
ArrayC4Planex6(arg: list[C4Plane])
ArrayC4Planex6(arg: Iterable[C4Plane])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayC4Vectorx4

ArrayC4Vectorx4()
ArrayC4Vectorx4(arg: list[C4Vector])
ArrayC4Vectorx4(arg: Iterable[C4Vector])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayCImVectorx256

ArrayCImVectorx256()
ArrayCImVectorx256(arg: list[CImVector])
ArrayCImVectorx256(arg: Iterable[CImVector])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayCImVectorx3

ArrayCImVectorx3()
ArrayCImVectorx3(arg: list[CImVector])
ArrayCImVectorx3(arg: Iterable[CImVector])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayFloatx16

ArrayFloatx16()
ArrayFloatx16(arg: list[float])
ArrayFloatx16(arg: Iterable[float])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayFloatx3

ArrayFloatx3()
ArrayFloatx3(arg: list[float])
ArrayFloatx3(arg: Iterable[float])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayIntx4

ArrayIntx4()
ArrayIntx4(arg: list[int])
ArrayIntx4(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayM2Vec2FP69x2

ArrayM2Vec2FP69x2()
ArrayM2Vec2FP69x2(arg: list[M2Vec2FP69])
ArrayM2Vec2FP69x2(arg: Iterable[M2Vec2FP69])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayShortIntx2

ArrayShortIntx2()
ArrayShortIntx2(arg: list[int])
ArrayShortIntx2(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayShortIntx256

ArrayShortIntx256()
ArrayShortIntx256(arg: list[int])
ArrayShortIntx256(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayShortIntx289

ArrayShortIntx289()
ArrayShortIntx289(arg: list[int])
ArrayShortIntx289(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayShortIntx3

ArrayShortIntx3()
ArrayShortIntx3(arg: list[int])
ArrayShortIntx3(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayShortIntx9

ArrayShortIntx9()
ArrayShortIntx9(arg: list[int])
ArrayShortIntx9(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayShortUnsignedIntx16

ArrayShortUnsignedIntx16()
ArrayShortUnsignedIntx16(arg: list[int])
ArrayShortUnsignedIntx16(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayShortUnsignedIntx3

ArrayShortUnsignedIntx3()
ArrayShortUnsignedIntx3(arg: list[int])
ArrayShortUnsignedIntx3(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArraySignedCharx2

ArraySignedCharx2()
ArraySignedCharx2(arg: list[int])
ArraySignedCharx2(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArraySignedCharx3

ArraySignedCharx3()
ArraySignedCharx3(arg: list[int])
ArraySignedCharx3(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedCharx16

ArrayUnsignedCharx16()
ArrayUnsignedCharx16(arg: list[int])
ArrayUnsignedCharx16(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedCharx2

ArrayUnsignedCharx2()
ArrayUnsignedCharx2(arg: list[int])
ArrayUnsignedCharx2(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedCharx32

ArrayUnsignedCharx32()
ArrayUnsignedCharx32(arg: list[int])
ArrayUnsignedCharx32(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedCharx4

ArrayUnsignedCharx4()
ArrayUnsignedCharx4(arg: list[int])
ArrayUnsignedCharx4(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedCharx8

ArrayUnsignedCharx8()
ArrayUnsignedCharx8(arg: list[int])
ArrayUnsignedCharx8(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedIntx4

ArrayUnsignedIntx4()
ArrayUnsignedIntx4(arg: list[int])
ArrayUnsignedIntx4(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedIntx6

ArrayUnsignedIntx6()
ArrayUnsignedIntx6(arg: list[int])
ArrayUnsignedIntx6(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

ArrayUnsignedIntx8

ArrayUnsignedIntx8()
ArrayUnsignedIntx8(arg: list[int])
ArrayUnsignedIntx8(arg: Iterable[int])

Default constructor

Copy constructor

Construct from a length-N iterable

Error

Bases: Exception

code instance-attribute

code: str

native_error instance-attribute

native_error: int

StorageOpenFailed

Bases: Error

wowlib failure category StorageOpenFailed.

ArchiveOpenFailed

Bases: Error

wowlib failure category ArchiveOpenFailed.

StorageNotOpen

Bases: Error

wowlib failure category StorageNotOpen.

FileNotFound

Bases: Error, FileNotFoundError

wowlib failure category FileNotFound.

PathNotResolvable

Bases: Error

wowlib failure category PathNotResolvable.

FdidNotResolvable

Bases: Error

wowlib failure category FdidNotResolvable.

ListfileParseError

Bases: Error

wowlib failure category ListfileParseError.

ListfileIoError

Bases: Error, OSError

wowlib failure category ListfileIoError.

FdidSpaceExhausted

Bases: Error

wowlib failure category FdidSpaceExhausted.

DuplicatePath

Bases: Error

wowlib failure category DuplicatePath.

InvalidPath

Bases: Error

wowlib failure category InvalidPath.

IoError

Bases: Error, OSError

wowlib failure category IoError.

EncryptedContent

Bases: Error

wowlib failure category EncryptedContent.

NotSupported

Bases: Error

wowlib failure category NotSupported.

NotImplemented

Bases: Error, NotImplementedError

wowlib failure category NotImplemented.

BackendError

Bases: Error

wowlib failure category BackendError.

ChunkTruncated

Bases: Error

wowlib failure category ChunkTruncated.

ChunkSizeMismatch

Bases: Error

wowlib failure category ChunkSizeMismatch.

ChunkMissing

Bases: Error

wowlib failure category ChunkMissing.

OffsetOutOfBounds

Bases: Error

wowlib failure category OffsetOutOfBounds.

InvalidEntityState

Bases: Error

wowlib failure category InvalidEntityState.

FormatVersionMismatch

Bases: Error

wowlib failure category FormatVersionMismatch.

UnsupportedClientVersion

Bases: Error

wowlib failure category UnsupportedClientVersion.

TableTruncated

Bases: Error

wowlib failure category TableTruncated.

TableMagicUnknown

Bases: Error

wowlib failure category TableMagicUnknown.

SchemaMismatch

Bases: Error

wowlib failure category SchemaMismatch.

SchemaBlobInvalid

Bases: Error

wowlib failure category SchemaBlobInvalid.

TableUnknown

Bases: Error

wowlib failure category TableUnknown.

to_client_version

to_client_version(expansion: Expansion) -> ClientVersion

The last-minor-of-major client version wowlib targets for this expansion (the versions constant).

Parameters:

Name Type Description Default
expansion Expansion

the expansion

required

Returns:

Type Description
ClientVersion

the matching versions constant

to_expansion

to_expansion(version: ClientVersion) -> Expansion | None

The expansion whose targeted release is exactly this version. Never matches a Classic constant — Classic clients are not expansion releases; pass version.format_lineage to ask which expansion's FORMATS one uses.

Parameters:

Name Type Description Default
version ClientVersion

a full client version

required

Returns:

Type Description
Expansion | None

the expansion, or None if the version is not one of the versions constants

expansion_of

expansion_of(version: ClientVersion) -> Expansion | None

The expansion a client version belongs to, by major version — works for any build, not just the targeted releases.

This is the CONTENT axis: Cataclysm Classic 4.4.2 reports Cata, because that is the game it is. It is NOT the format axis — that same client writes War Within-era files. For formats, ask to_expansion(version.format_lineage) instead.

Parameters:

Name Type Description Default
version ClientVersion

a full client version

required

Returns:

Type Description
Expansion | None

the expansion, or None for unknown majors

Version constants (wowlib.versions)

One ready-made ClientVersion per finished expansion — the exact last-minor-of-major build wowlib targets — so code never spells build numbers:

from wowlib import versions
from wowlib.fs import FileSystem, FileSystemSettings

fs = FileSystem.open(FileSystemSettings("/Games/WoW 3.3.5a", versions.wotlk))

There is also one per living Classic product line (classic_era, classic_bcc, classic_wotlk, classic_cata, classic_mop, anniversary). Those are modern-engine clients wearing legacy version numbers, so their flavor is not Retail and their file formats follow format_lineage — the retail branch their build was cut on — rather than their major. Since those products ship new builds continuously, the constants are snapshots: for a real installation prefer ClientInstall.detect.

The releases wowlib targets: the last-minor-of-major of every finished expansion (Midnight 12.x is ongoing and has no final build yet), plus the newest build of each living Classic product line. Builds verified against wago.tools.

The Classic constants are snapshots of a MOVING target — those products ship new builds continuously, and a newer build can land on a newer engine (Classic 4.4.0 is Dragonflight-era, 4.4.1 already War Within-era). Pin the exact build you have, or let ClientInstall.detect read it off the install.

vanilla module-attribute

vanilla: ClientVersion = ...

tbc module-attribute

tbc: ClientVersion = ...

wotlk module-attribute

wotlk: ClientVersion = ...

cata module-attribute

cata: ClientVersion = ...

mop module-attribute

mop: ClientVersion = ...

wod module-attribute

wod: ClientVersion = ...

legion module-attribute

legion: ClientVersion = ...

bfa module-attribute

bfa: ClientVersion = ...

shadowlands module-attribute

shadowlands: ClientVersion = ...

dragonflight module-attribute

dragonflight: ClientVersion = ...

tww module-attribute

tww: ClientVersion = ...

classic_era module-attribute

classic_era: ClientVersion = ...

classic_bcc module-attribute

classic_bcc: ClientVersion = ...

classic_wotlk module-attribute

classic_wotlk: ClientVersion = ...

classic_cata module-attribute

classic_cata: ClientVersion = ...

classic_mop module-attribute

classic_mop: ClientVersion = ...

anniversary module-attribute

anniversary: ClientVersion = ...