No description
Find a file
2020-03-19 23:11:35 +03:00
src Fix memory leak, some other fixes 2020-03-19 23:05:57 +03:00
tests Fix memory leak, some other fixes 2020-03-19 23:05:57 +03:00
.gitignore Init repository 2017-06-15 23:40:28 +03:00
.travis.yml Use 18.04 (newer gcc) 2020-03-19 23:11:35 +03:00
LICENSE Init repository 2017-06-15 23:40:28 +03:00
osureplay.nimble Use stdlib "streams" module instead of custom int reading. 2017-07-26 23:22:33 +03:00
README.md Updates 2017-08-20 13:51:30 +03:00

osureplay, a parser for osu replays in Nim Build Status

This is a parser for osu! rhythm game replay files as described by https://osu.ppy.sh/wiki/Osr_(file_format).

Originally this parser was ported from this Python replay parser

Installation

To install osureplay, simply run:

$ nimble install osureplay

Documentation

To parse a replay from a filepath:

import osureplay

let replay = parseReplayFile("replay.osr")

To parse a replay from a string which contains replay data:

import osureplay

let replay = parseReplay(data)

Replay objects provide these fields

replay.gameMode # GameMode enum
replay.gameVersion # Integer
replay.beatmapHash # String
replay.playerName # String
replay.replayHash # String
replay.number300s # Integer
replay.number100s # Integer
replay.number50s # Integer
replay.gekis # Integer
replay.katus # Integer
replay.misses # Integer
replay.score # Integer
replay.maxCombo # Integer
replay.isPerfectCombo # Boolean
replay.mods # set of Mods
replay.lifeBarGraph # String, unparsed as of now
replay.timestamp # TimeInfo object
replay.playEvents # Sequence of ReplayEvent tuples

ReplayEvent tuples provide these fields

event.timeSincePreviousAction # Integer representing time in milliseconds
event.x # X axis location
event.y # Y axis location
event.keysPressed # Bitwise sum of keys pressed, documented in OSR format page.
event.timestamp # Absolute timestamp (from replay start)