Skip to main content

Parsing library for SSBM replay files

Project description

Py-slippi is a Python parser for .slp game replay files for Super Smash Brothers Melee for the Nintendo GameCube. These replays are generated by Jas Laferriere’s Slippi recording code, which runs on a GameCube or the Dolphin emulator.

Installation

Requires Python >= 3.6. To install, run the following command (optionally inside a virtual environment):

pip install py-slippi

Usage

Reading from a replay file:

>>> from slippi import Game
>>> game = Game('test/replays/game.slp')
>>> game.metadata
Metadata(date=2018-06-22 07:52:59+00:00, duration=5086, platform=Platform.DOLPHIN, players=(Player(characters={InGameCharacter.MARTH: 5086}), Player(characters={InGameCharacter.FOX: 5086}), None, None))
>>> game.start
Start(is_teams=False, players=(Player(character=CSSCharacter.MARTH, costume=3, stocks=4, team=None, type=Type.HUMAN, ucf=UCF(dash_back=False, shield_drop=False)), Player(character=CSSCharacter.FOX, costume=0, stocks=4, team=None, type=Type.CPU, ucf=UCF(dash_back=False, shield_drop=False)), None, None), random_seed=3803194226, slippi=Slippi(version=1.0.0.0), stage=Stage.YOSHIS_STORY)
>>> game.end
End(method=Method.CONCLUSIVE)
>>> game.frames[0]
Frame(index=-123, ports=(Port(follower=None, leader=Data(post=Post(character=InGameCharacter.MARTH, combo_count=0, damage=0.00, direction=Direction.RIGHT, last_attack_landed=None, last_hit_by=None, position=(-31.94, 0.00), shield=59.66, state=ActionState.LANDING, state_age=7.00, stocks=4), pre=Pre(buttons=Buttons(logical=Logical.NONE, physical=Physical.NONE), cstick=(0.00, 0.00), direction=Direction.RIGHT, joystick=(0.00, 0.00), position=(-32.08, 0.00), random_seed=1373931959, state=ActionState.LANDING, triggers=Triggers(logical=0.00, physical=Physical(l=0.00, r=0.00))))), Port(follower=None, leader=Data(post=Post(character=InGameCharacter.FOX, combo_count=0, damage=0.00, direction=Direction.LEFT, last_attack_landed=None, last_hit_by=None, position=(9.96, 53.35), shield=60.00, state=ActionState.JUMP_F, state_age=19.00, stocks=4), pre=Pre(buttons=Buttons(logical=Logical.NONE, physical=Physical.NONE), cstick=(0.00, 0.00), direction=Direction.LEFT, joystick=(-0.99, 0.00), position=(10.78, 54.04), random_seed=1373931959, state=ActionState.JUMP_F, triggers=Triggers(logical=0.00, physical=Physical(l=0.00, r=0.00))))), None, None))

Iterating over frame data:

for frame in game.frames:
    data = frame.ports[0].leader # see also: port.follower (ICs)
    print(data.post.state) # character's post-frame action state

API Docs

See the Module Index for detailed API docs, starting with slippi.game.

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

py-slippi-1.2.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_slippi-1.2.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file py-slippi-1.2.0.tar.gz.

File metadata

  • Download URL: py-slippi-1.2.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for py-slippi-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f14f03b7e6afa27ee8f8203fbc432bc712e781740aa49ca269c41fb763f4df72
MD5 3c924fdb90a82856aedd03423dfc59fa
BLAKE2b-256 f45442b542c16c208351be5ca51dd0fe03020b8b53586b808c799ffc4ffd2ee4

See more details on using hashes here.

File details

Details for the file py_slippi-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: py_slippi-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for py_slippi-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82f7092729d4f43cb0511d0fddf0f321b8a98ff85c0ddc01b962bfaa9fc1b20a
MD5 8b099911011df49f1ef7dd4e0e6a13f0
BLAKE2b-256 401bd1acacac5b49b5fa76cb8acb9a522080543355d6e7e0096ab7f114520f06

See more details on using hashes here.

Supported by

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