Skip to main content

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 are two functions in peppi_py:

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

Both of these parse a replay file (.slp or .slpp respectively), and return an object with these keys:

  • start
  • end
  • metadata
  • hash
  • 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.read_slippi('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


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.6.0.tar.gz (1.6 MB view hashes)

Uploaded Source

Built Distribution

peppi_py-0.6.0-cp39-abi3-macosx_11_0_arm64.whl (814.5 kB view hashes)

Uploaded CPython 3.9+ macOS 11.0+ ARM64

Supported by

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