osureplay

osu! replay parser

Pure Nim score 30/100 · tests present · docs generated

Summary

Latest Version Unknown
License MIT
CI Status Passing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install osureplay
choosenim install osureplay
git clone https://github.com/nimbackup/nim-osureplay

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
osureplay - - - - - - -

Source

Repository https://github.com/nimbackup/nim-osureplay
Homepage https://github.com/nimbackup/nim-osureplay
Documentation View Documentation
Registry Source nimble_official

README

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)