aoe2rec-py
raw JSON → 0.1.21 verified Fri May 01 auth: no python
Python bindings for aoe2rec, a Rust library for parsing Age of Empires 2 recorded game files. Currently at version 0.1.21, requires Python >=3.9, and is released alongside the core aoe2rec crate. Development is active via GitHub.
pip install aoe2rec-py Common errors
error ImportError: No module named aoe2rec-py ↓
cause Using hyphens in import statement instead of underscores.
fix
Change import to: from aoe2rec_py import parse_recording
error TypeError: argument must be a string, not None ↓
cause Passing None or invalid path to parse_recording.
fix
Ensure the file path is a valid string pointing to an existing .aoe2record file.
Warnings
gotcha The import path uses underscores: 'aoe2rec_py', not hyphens. Common mistake: 'from aoe2rec-py import ...' fails. ↓
fix Use `from aoe2rec_py import ...` (underscores).
gotcha The library may not parse all versions of recorded games, especially very old or modded ones. The underlying Rust crate is under active development. ↓
fix Check the aoe2rec core crate for version support and open issues if a recording fails.
deprecated The function `parse_recording` may be renamed to `load_recording` in future versions; check latest docs. ↓
fix Stay updated; the import path and function name are likely to stabilize.
Imports
- parse_recording
from aoe2rec_py import parse_recording - Recording
from aoe2rec_py import Recording
Quickstart
from aoe2rec_py import parse_recording
# Replace with a path to a valid .aoe2record file
recording = parse_recording("path/to/recording.aoe2record")
print(f"Map: {recording.map_name}")
print(f"Players: {len(recording.players)}")