Releases: kszlim/osu-replay-parser
v7.0.1
v7.0.0
Breaking Changes
This release applies a breaking change by removing the first two frames of osr lzma data. No api methods or signatures have been changed. If you do not rely on the specifics of replay frames, you may safely upgrade. Otherwise, read below.
The first two frames of an osr are unusual: the first frame always has a time of 0 and a position of (256, -500), while the second frame has a time value of first_break - 1
and a similar position of (256, -500). These are marker frames placed by stable. Previously, we left them in, but these two frames can cause issues for non-std gamemodes. For instance, an x value of 256
is treated as K9
in mania.
We now remove both of these frames. If you need access to the values contained in these frames for whatever reason, and can no longer access them due to this release, please open an issue.
v6.0.2
v6.0.1
v6.0.0
Parsing replays is now done through static methods on Replay
:
Replay.from_path
- parse from a path (most common)Replay.from_file
- parse from a live file objectReplay.from_string
- from a string holding the contents of a replay
The concept of "pure lzma" and parsing only the replay data portion of a replay has been replaced with parse_replay_data
, which takes optional parameters decoded
and decompressed
, as well as a new mode
parameter. It now returns List[ReplayEvent]
instead of a Replay
with only play_data
filled, as before.
Replay writing has been added, and is done through a matching set of methods:
Replay.write_path
- write the replay back to a pathReplay.write_file
- write the replay back to a live file objectReplay.pack
- return the contents of the replay as a string, suitable for writing to an osr file
Also added replay.rng_seed
, which will be set for replays which have the rng seed.
Several attributes have been renamed to bring osrparse closer to osu!'s internal naming of attributes:
number_{300, 100, 50}s
->count_{300, 100, 50}
{geki, katu, misses}
->{count_geki, count_katu, count_miss}
is_perfect_combo
->perfect
game_mode
->mode
player_name
->username
play_data
->replay_data
mod_combination
->mods
Finally, this release brings a readthedocs: https://kevin-lim.ca/osu-replay-parser/.
v5.0.0
- add parsing for all gamemodes, not just osu!std
- each gamemodes returns their own
ReplayEvent
subclasses with specific attributes. See the readme for documentation on each mode'sReplayEvent
subclass
- each gamemodes returns their own
- rename
ReplayEvent.time_since_previous_action
toReplayEvent.time_delta
- rename
ReplayEvent.keys_pressed
toReplayEvent.keys
- change
ReplayEvent.keys_pressed
(nowReplayEvent.keys
) to a newKey
enum instead of a raw int
v4.0.1
v4.0.0
- parse
replay_id
for replays - add scorev2 and mirror mods
mod_combination
is now anIntFlag
instead of a list of enums- add support for parsing "pure" lzma strings
- this is useful for replays retrieved from the api, since the api only gives us the lzma replay data and nothing else, unlike osr files
- remove the last frame, which contains the "rng seed", after a certain osu! version
- add type annotations to public-facing members
- rename
GameMode
members for consistency - implement
__str__
,__eq__
,__hash__
forReplayEvent
- replace raising
Exception
with raisingValueError
instead