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
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.
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.

Parses a recording file and prints map name and player count. Works directly with saved .aoe2record files.

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)}")