forum

osu! database parsers for Python + collections editor

posted
Total Posts
2
Topic Starter
shawnachu
Fair warning: These scripts will muck around with your osu! database files, but only edit_collections will attempt to write anything back. If you're a bit paranoid, I would recommend making copies of the database files and working on those.

---

I've put together a small set of parsing tools for reading the osu! database files. These will allow you to transform the files' packed binary data into a human-readable JSON format.

You can find the repository here:
https://github.com/chudooder/osutools

You'll need python 2.7+ to run the scripts.

Files

dbparse.py: contains functions that take a string as input and return a Python dictionary containing the parsed information; the function names should be self-explanatory.
edit_collections.py is an interactive program that lets you add collections based on filters (see below for full usage instructions).

Other stuff:
augdata.py combines a scores json with a beatmaps json; transform.py turns this into a csv. mine.py does some extra field generating. This is for the included data visualizer.
stats.html (and its linked files) is a data visualization experiment using d3.js that shows your scores and progression as a player on two plots.

Collections Editor
Note that no changes are written back until the user calls save or quit (with confirmation).

Available commands:
help : lists these commands.
remove <index> : removes the collection from the list.
quit: prompts the user to save, then exits
save [fp] : saves the collections file. If there is a second argument, saves at that location.
list <index> : lists the beatmaps in the given collection.
add : adds a new collection to the list via additional prompts.

Adding filters:
Each filter is a field to search on, an operator, and a value. A beatmap will end up in the collection if it passes the conditions in all of the filters. Once you're done adding filters, type "done" to exit.

Available filters:
  1. OD: overall difficulty
  2. AR: approach rate
  3. CS: circle size, or the number of keys in mania
  4. HP: hp drain
  5. DRAIN: drain time
  6. LENGTH: total song length
  7. STARS: star difficulty
  8. SLIDERV: slider velocity
  9. BPM: main beats per minute
  10. MINBPM: the minimum bpm of the song
  11. MAXBPM: the maximum bpm of the song
  12. MODE: the mode of the beatmap. 0=std, 1=taiko, 2=ctb, 3=mania
  13. OBJECTS: total number of hit objects in the song
  14. CIRCLES: total number of hit circles, or taiko circles, or fruits, or key hit things
  15. SLIDERS: total number of sliders or your regional equivalent
  16. SPINNERS: total number of spinners or your regional equivalent
  17. RANKED: is the map ranked? 1 if true
  18. ARTIST: the artist of the song
  19. TITLE: the title of the song (not the unicode one)
  20. DIFFNAME: the name of the song difficulty (Easy, Insane, Skystar...)
  21. CREATOR: the name of the beatmap creator
  22. TAGS: tags in the beatmap
  23. TOPRANK: the rank of the highest score personally achieved on the beatmap. F = not played, D, B, C, A, S, SS all work otherwise
  24. TOPCOMBO: the combo of the highest score personally achieved on the beatmap
  25. PASSES: number of times the beatmap was passed
Operators:
=, ==, !=, >, <, >=, and <= are self-explanatory. ? is "contains", which is useful for searching tags. !? is "does not contain".
Lapoozza
Make a bat script to run the programs. That way it will be easier to run them :P
Please sign in to reply.

New reply