Skip to main content

No project description provided

Project description

peppi-py

Python bindings for the peppi Slippi replay parser, built using Apache Arrow and PyO3.

Installation

pip install peppi-py

To build from source instead, first install Rust. Then:

pip install maturin
maturin develop

Usage

peppi-py exposes two functions:

  • read_slippi(path, skip_frames=False)
  • read_peppi(path, skip_frames=False)

Both of these parse a replay file (.slp or .slpp respectively) into a Game object.

Frame data is stored as a struct-of-arrays for performance, using Arrow. So to get the value of an attribute "foo.bar" for the nth frame of the game, you'd write game.frames.foo.bar[n] instead of game.frames[n].foo.bar. See the code example below.

You can do many other things with Arrow arrays, such as converting them to numpy arrays. See the pyarrow docs for more, particularly the various primitive array types such as Int8Array.

Also see the Slippi replay spec for detailed information about the available fields and their meanings.

>>> from peppi_py import read_slippi, read_peppi
>>> game = read_slippi('tests/data/game.slp')
>>> game.metadata
{'startAt': '2018-06-22T07:52:59Z', 'lastFrame': 5085, 'players': {'1': {'characters': {'1': 5209}}, '0': {'characters': {'18': 5209}}}, 'playedOn': 'dolphin'}
>>> game.start
Start(slippi=Slippi(version=(1, 0, 0)), ...)
>>> game.end
End(method=<EndMethod.RESOLVED: 3>, lras_initiator=None, players=None)
>>> game.frames.ports[0].leader.post.position.x[0]
<pyarrow.FloatScalar: -42.0>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peppi_py-0.8.0.tar.gz (31.2 MB view details)

Uploaded Source

Built Distributions

peppi_py-0.8.0-pp311-pypy311_pp73-win_amd64.whl (1.2 MB view details)

Uploaded PyPyWindows x86-64

peppi_py-0.8.0-pp310-pypy310_pp73-win_amd64.whl (1.2 MB view details)

Uploaded PyPyWindows x86-64

peppi_py-0.8.0-pp39-pypy39_pp73-win_amd64.whl (1.2 MB view details)

Uploaded PyPyWindows x86-64

peppi_py-0.8.0-cp313-cp313t-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.13tWindows x86-64

peppi_py-0.8.0-cp310-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10+Windows x86-64

peppi_py-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

peppi_py-0.8.0-cp310-abi3-macosx_11_0_arm64.whl (838.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file peppi_py-0.8.0.tar.gz.

File metadata

  • Download URL: peppi_py-0.8.0.tar.gz
  • Upload date:
  • Size: 31.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.4

File hashes

Hashes for peppi_py-0.8.0.tar.gz
Algorithm Hash digest
SHA256 d685caec2ca609ab98575ef56b65a49b8fa404426c7d0669a68d0e66dcef440e
MD5 1d116f4610262d22d99dbf2f6b34db77
BLAKE2b-256 dd3aae09970c608fa30a9c3f4536a858559c0c008f3fdbef497270d1d1f8e7cb

See more details on using hashes here.

File details

Details for the file peppi_py-0.8.0-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for peppi_py-0.8.0-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 889f13005b39ac90b244be88db2e8ecf62f13a2428f23c929703711bf734309a
MD5 7520dcba6de52b2c63631d39d1dc3e64
BLAKE2b-256 1f5fab7f2d9e5127be8013ff6f149f494ac2d8d9cb5e4dda0b59d5a776fc17a5

See more details on using hashes here.

File details

Details for the file peppi_py-0.8.0-pp310-pypy310_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for peppi_py-0.8.0-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 6ceb51132a8ae85b684d9d9c744cc8202cb1990d6abb3da10cae1a2b7fe97d55
MD5 30255965a97a66a894d3ba654328464c
BLAKE2b-256 98e25db1d8b59b0e003b1db98467cb4e57da77625a7053c0576c8cbcbb3b8d29

See more details on using hashes here.

File details

Details for the file peppi_py-0.8.0-pp39-pypy39_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for peppi_py-0.8.0-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 7c9a392ef76a20a996a29203ab6535f6996983dfee35a49d2501315a5d463498
MD5 4d6d2c5f9b9c33d1cb8202358db729aa
BLAKE2b-256 71e83342dc2c4ab78e2a58a7f4e523afdbed6c984291a743f11adbd77725c6d0

See more details on using hashes here.

File details

Details for the file peppi_py-0.8.0-cp313-cp313t-win_amd64.whl.

File metadata

  • Download URL: peppi_py-0.8.0-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.13t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for peppi_py-0.8.0-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 a1e094a4cd4a85001932a4492ce807d4c4dd783ec06d784566530e4981fe5478
MD5 ac423e3ec76fa9f89deb4cc7e32503bb
BLAKE2b-256 6c618f785c8642c6e73ca975e5bc295d19a206d4e66c2cb965811abb2540beb7

See more details on using hashes here.

File details

Details for the file peppi_py-0.8.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: peppi_py-0.8.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for peppi_py-0.8.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1abc46cd92285a96d2d59ff7596c855568a26c9548e6ba35c0071641df3cd645
MD5 947f4f9c0c210813b4da2c4a8af6abb9
BLAKE2b-256 423fc32a28228c991d4ff6df592361cd56a8873fd05394736a2e043fafcf57a1

See more details on using hashes here.

File details

Details for the file peppi_py-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for peppi_py-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b3eb7de18524015d34daa121bab5365396a7ba723150356435d4fd8c872c9d9c
MD5 18f7e9be167f670677dd098193deef4d
BLAKE2b-256 b11803628c79b20d39a87332a7942c10fd9bd0424fb29bf18fa0f98ba0354af5

See more details on using hashes here.

File details

Details for the file peppi_py-0.8.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for peppi_py-0.8.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3eeb6228164ccc8ae1e1f7b4a81088bb645ccb947e2fb2121fd57dcfbbf590b
MD5 7733e6dac1f62da81bd78e37d4f0ad9e
BLAKE2b-256 ff6be95a1726d1d01f9137c38f83015725a06d7ba06654710624b9246af2795d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page