No project description provided
Project description
peppi-py
Python bindings for the peppi replay parser for Slippi, built using Apache Arrow and PyO3.
Installation
pip install peppi-py
Usage
There is only one function, peppi_py.game(path)
, which parses a replay file and returns a dict with these keys:
metadata
start
end
frames
The first three are regular dicts, but frames
is an Arrow StructArray
object. This can be treated as an array of dicts, but thanks to Arrow's columnar format you can do many other things such as convert columns to numpy arrays. See the pyarrow docs for more, particularly StructArray and StructScalar (which is what you get when you subscript a StructArray
).
Also see the Slippi replay spec for detailed information about the available fields and their meanings.
⚠️ peppi-py is still alpha, so expect breaking changes!
>>> import peppi_py
>>> game = peppi_py.game("game.slp")
>>> game['metadata']
{'lastFrame': 11238,
'playedOn': 'dolphin',
'players': {'0': {'characters': {'18': 11469},
'names': {'code': 'AAAA#123', 'netplay': 'abbott'}},
'1': {'characters': {'17': 11469},
'names': {'code': 'BBBB#456', 'netplay': 'costello'}}},
'startAt': '2020-08-01T19:41:19Z'}
>>> f = game['frames'][0]
>>> f['ports'][0]['leader']['post']['position']
<pyarrow.StructScalar: {'x': -42.0, 'y': 26.600000381469727}>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for peppi_py-0.5.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1887f74808f9f66c7f7413e613fcbe6b20c8138116081cb2f27d2add580c75bd |
|
MD5 | 91679d7be81e36b59e21cbe434ca54ff |
|
BLAKE2b-256 | c00f77b112f255b383b73a8e78486ae82a26be6b824f44658a1509be42d4c05a |
Hashes for peppi_py-0.5.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a140d334976a5532e6f2a603cee99ee5ee5751db8f6377bd09607eaf2e056a18 |
|
MD5 | 66900de2a33e30f9fa104aad810cafb3 |
|
BLAKE2b-256 | 312720fa62e17495b91cbb05db705878a412be1fcba503be06c546ce34e745e4 |