wc3files
Warcraft III maps files reader and writer for Python
A Python library for reading and writing various Warcraft III file formats. This library allows you to work with map files, object data, regions, replays, and more.
Installation
pip install wc3files
Or with conda:
conda install -c conda-forge wc3files
Python 3.9 or newer. Pure Python - no compiler, and no StormLib or game install needed.
Documentation
Full documentation lives in docs/:
- Getting started - install, then the three core workflows
- Concepts - the rules that explain the API's shape
- Formats - every format, its class, and how far support goes
- API reference - every public class and method
- Command line - the
wc3filescommand and its 26 subcommands - Triggers and scripts - GUI triggers, JASS/Lua, and rebuilding editor triggers from a compiled script
Features
MPQ Archives
- Read and extract MPQ archive files (Blizzard's proprietary archive format)
- Access individual files within MPQ archives
- Handle encryption, compression, and other MPQ-specific features
Map Files (W3X)
- Read and write Warcraft III map files (.w3x)
- Access map resources and components
Object Data (W3O)
- Parse and modify object data files (.w3o)
- Work with SLK (Symbolic Link) files
- Handle WES (World Editor Strings) files
- Process configuration files (CFG)
Region Data (W3R)
- Read and write region files (.w3r)
- Manipulate region information in maps
Replay Files (W3G)
- Parse Warcraft III replay files (.w3g)
- Extract game information, player data, and actions
Usage Examples
Working with MPQ Archives
from wc3files.mpq import MPQ
# Open an MPQ archive
mpq = MPQ("path/to/archive.mpq")
# List files in the archive
files = mpq.list_files()
print(files)
# Extract a file
data = mpq.extract_file("path/in/archive.txt")
Working with Object Data
from wc3files.w3o import ObjectFile
# Load an object file
obj_file = ObjectFile.from_file("path/to/war3map.w3u")
# Access object data
for obj in obj_file.objects:
print(f"Object ID: {obj.id}")
print(f"Modifications: {obj.modifications}")
Working with Region Data
from wc3files.w3r import RegionFile
# Load a region file
region_file = RegionFile.from_file("path/to/war3map.w3r")
# Access regions
for region in region_file.regions:
print(f"Region: {region.name}")
print(f"Position: {region.position}")
print(f"Size: {region.size}")
Working with Replay Files
from wc3files.w3g import ReplayFile
# Load a replay file
replay = ReplayFile.from_file("path/to/replay.w3g")
# Access replay data
print(f"Game: {replay.header.game_identifier}")
print(f"Version: {replay.header.version}")
print(f"Players: {len(replay.player_records)}")
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for wc3files 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| wc3files-0.1.0.tar.gz | 3.8 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wc3files-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 MB
Release files / wc3files-0.1.0.tar.gz
| Download URL | wc3files-0.1.0.tar.gz |
|---|---|
| Size | 3.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
542aa7ab7444267e8faaede5f1cf8081784712b2b459333f600afac010dca6ef
|
|
BLAKE2b-256 checksum How to use checksums |
38e477c460f348b60cd5921636b7cac23e155402419bd192c72889c7784a80a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / wc3files-0.1.0-py3-none-any.whl
| Download URL | wc3files-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78a24e1f7e2c7b8eaa2db8e1e9449c2c93d58a70e26b6f6af58974605e89ef4f
|
|
BLAKE2b-256 checksum How to use checksums |
8e49e101adfb785e7d44226d7fae11517d50b7b853ebb348ce26df35c3862f5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for wc3files 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.