Command Line Interface
This package includes a command line interface (CLI). This CLI allows you to view the data of a beatmap or a beatmap set, or to export all the beatmap data of an osu! directory in .csv or .xlsx.

Command

To use the CLI, use the following command
1
python -m osuData
Copied!
This command needs arguments.

Help

1
usage: osupy [-h] [--limit LIMIT] [--beatmap] [--set] [--output {csv,xlsx}] [--play] [path]
2
3
Utility to export beatmaps from osu! folder into xlsx or csv file.
4
5
positional arguments:
6
path The path of beatmap, beatmap set or osu! folder
7
8
optional arguments:
9
-h, --help show this help message and exit
10
--limit LIMIT The maximum of beatmap to export. Default: no limit
11
--beatmap If "path" is a beatmap. Display data of the beatmap.
12
--set If "path" is a beatmap set. Display data of the beatmap set.
13
--output {csv,xlsx} If path is the osu! folder, indicate the output format of data.
14
--play If path is a beatmap or beatmap set, play the music of beatmap set.
15
Copied!

Arguments

path

path must be the path of beatmap, beatmap set or osu! folder. According to the other arguments passed to the command.
With no beatmap and set arguments passed to the command, path must be the path of the osu! folder.
If beatmap and set arguments are not passed to the command and that path is the path of the osu! folder, the command export all beatmaps from osu! folder in a .csv file.

limit

limit must be an integer. It's the maximum of beatmap to export. This argument is use for export beatmap from osu! folder.

beatmap

If beatmap argument is used, path argument must be the path of a beatmap (.osu file). With this argument, data of the beatmap will displayed but not exported.

set

If set argument is used, path argument must be the path of a beatmap set folder (folder containing .osu file). With this argument, data of the beatmap set will displayed but not exported.
beatmap argument has priority over set argument. If both are passed to the command, only beatmap is used, and path argument must be a beatmap (.osu file).

output

To use if beatmap and set arguments are not used. output is the type of file for the export (csv or xlsx).
For xlsx file, a maximum of 1048576 beatmap are exported (max of lines in Excel, tested on Excel 2019).
With xlsx files, hitobjects data are exported in a second sheet into the file.

play

The path must be a beatmap (.osu file) or a beatmap set. If play argument is used, the music of beatmap set is played.
ffmpeg must be install.

Examples

Display beatmap data

Command:
1
python -m osupy "C:/osu!/Songs/1 Kenji Ninuma - DISCO PRINCE/Kenji Ninuma - DISCOüÜPRINCE (peppy) [Normal].osu" --beatmap
Copied!
Output:
1
Version_fmt Mode Stars PP HP CS OD AR SV TickRate CountNormal CountSlider CountSpinner Time
2
0 3 0 2.394922 33.183659 6.0 4.0 6.0 6.0 1.4 2.0 160 30 4 135751.0
3
Copied!
The pp number is calculate without mod and an accuracy of 100%.

Display beatmap set data

Command:
1
python -m osupy "C:/osu!/Songs/8506 Linkin Park - Numb" --set
Copied!
Output:
1
metadata:
2
Version_fmt Mode Stars PP HP CS OD AR SV TickRate CountNormal CountSlider CountSpinner Time Title Artist Date_Add
3
0 5 0 2.328151 31.991653 5.0 4.0 6.0 6.0 1.8 1.0 160 109 6 173126.0 Numb Linkin Park 2020-11-17 19:02:15
4
1 5 0 4.062595 111.861809 7.0 5.0 8.0 8.0 2.0 1.0 232 130 4 173126.0 Numb Linkin Park 2020-11-17 19:02:15
5
2 5 0 2.107753 15.901615 5.0 4.0 4.0 4.0 2.2 2.0 120 48 6 154314.0 Numb Linkin Park 2020-11-17 19:02:15
6
7
hitobjects:
8
Type StartTime EndTime Sound X Y PathType Kind
9
0 circle 3107.0 3107.0 0 256.0 280.0 NaN {'kind': 'circle', 'pixel_len': None, 'repeats...
10
1 circle 3380.0 3380.0 2 208.0 200.0 NaN {'kind': 'circle', 'pixel_len': None, 'repeats...
11
2 circle 3652.0 3652.0 0 304.0 200.0 NaN {'kind': 'circle', 'pixel_len': None, 'repeats...
12
3 slider 3925.0 3925.0 2 344.0 112.0 bezier {'kind': 'slider', 'pixel_len': 180.0, 'repeat...
13
4 slider 4742.0 4742.0 2 168.0 208.0 bezier {'kind': 'slider', 'pixel_len': 180.0, 'repeat...
14
.. ... ... ... ... ... ... ... ...
15
810 circle 169690.0 169690.0 4 256.0 32.0 NaN {'kind': 'circle', 'pixel_len': None, 'repeats...
16
811 circle 170235.0 170235.0 8 256.0 152.0 NaN {'kind': 'circle', 'pixel_len': None, 'repeats...
17
812 circle 170508.0 170508.0 0 256.0 152.0 NaN {'kind': 'circle', 'pixel_len': None, 'repeats...
18
813 slider 170781.0 170781.0 4 160.0 176.0 bezier {'kind': 'slider', 'pixel_len': 220.0, 'repeat...
19
814 spinner 172689.0 176233.0 4 256.0 192.0 NaN {'kind': 'spinner', 'pixel_len': None, 'repeat...
20
21
[815 rows x 8 columns]
22
Copied!

Export beatmap from osu! folder

Command:
1
python -m osupy "C:/osu!"
Copied!
Output: The progression and path of the csv file.
1
[2021-09-19 to 19:17:34][SUCCESS] Merge all data completed
2
[2021-09-19 to 19:17:34][INFO] the csv file is being created...
3
[2021-09-19 to 19:17:34][INFO] csv file save in /path/of/osu_data.csv
Copied!

Export beatmap from osu! folder in xlsx file

Command:
1
python -m osupy "C:/osu!" --output xlsx
Copied!
Output: The progression and path of the xlsx file.
1
[2021-09-19 to 19:20:29][SUCCESS] Merge all data completed
2
[2021-09-19 to 19:20:32][INFO] the 'metadata' sheet is being created...
3
[2021-09-19 to 19:20:35][INFO] Excel file save in /home/lost/osu_data.xlsx
Copied!
Last modified 1mo ago
Copy link