#osu #db #collection #replay #scores #binary #beatmap

osu-db

Reading and writing of osu! binary files: osu!.db, collection.db, scores.db and .osr replay files

3 releases (breaking)

0.3.0 Nov 18, 2021
0.2.0 Oct 30, 2020
0.1.0 Jan 29, 2019

#843 in Games

Download history 21/week @ 2024-06-16 12/week @ 2024-06-23 4/week @ 2024-06-30 8/week @ 2024-07-07 12/week @ 2024-07-14 8/week @ 2024-07-21 26/week @ 2024-07-28 9/week @ 2024-08-04 18/week @ 2024-08-11 2/week @ 2024-08-18 14/week @ 2024-08-25 10/week @ 2024-09-01 7/week @ 2024-09-08 9/week @ 2024-09-15 40/week @ 2024-09-22 31/week @ 2024-09-29

88 downloads per month
Used in rosu-v2

Unlicense

57KB
1.5K SLoC

osu-db

osu-db is an osu! binary file format encoder/decoder, providing support for loading, modifying and saving the following osu! file formats:

  • osu!.db: The main beatmap information cache osu! uses.
  • collection.db: A list of collections and the beatmaps they contain.
  • scores.db: Overview of all user scores.
  • .osr files: Individual in-depth score data of a single replay.

To use, simply add this line to your Cargo.toml:

osu-db = "0.3"

After that you will want to use the different load/save functions on the Listing (cached beatmap database), ScoreList (summary of all player scores), CollectionList (in-game beatmap collections) or Replay (a single in-depth standalone replay file).

For example, to change all of your osu!mania grades to SS+:

use osu_db::listing::{Listing, Grade};

// Load the listing to memory
let mut listing = Listing::from_file("osu!.db").unwrap();

// Modify listing in-place
for beatmap in listing.beatmaps.iter_mut() {
    beatmap.mania_grade = Grade::SSPlus;
}

// Save back to disk
listing.save("osu!.db").unwrap();

More details in the crate documentation.

osu-db has been tested to support osu!stable binaries of at least version 20211103, and will probably support newer binaries. Old binaries are supported, as old as 2014, although these are no longer tested and no guarantees are made.

Dependencies

~1.7–2.6MB
~46K SLoC