BMS Difficulty Table Parsing Library
A Rust library to parse BMS difficulty tables. It can build a complete data structure from header JSON and chart data JSON, covering the header, courses, trophies and chart items.
Features
- Extract the header JSON URL from HTML
<meta name="bmstable">. - Parse the header JSON into
BmsTableHeader; unrecognized fields are preserved inextra. - Parse chart data into
BmsTableData, supporting a plain array ofChartItemstructure. - Automatically convert
md5/sha256lists in courses toChartItem;leveldefaults to"0".
API Overview
BmsTable: top-level data structure containingheaderanddata.BmsTableHeader: header metadata; unrecognized fields are preserved inextra.BmsTableData: chart data as an array.CourseGroup: recursive course tree supporting arbitrary nesting depth (Coursesleaf /SubGroupsbranch).CourseInfo: course information; supports automatically convertingmd5/sha256lists to chart items.ChartItem: a chart entry; spec-defined fields plusextrafor forward compatibility.Trophy: trophy requirements (max miss rate, minimum score rate).BmsTableInfo/BmsTableList: data types for difficulty table list JSON.BmsTableHtml: HTML parsing operations; seeextract_url(returns a borrowed&str— zero-copy).
Examples
The examples/ directory contains network fetching examples that demonstrate how to fetch BMS difficulty tables over HTTP using reqwest (available as a dev-dependency):
examples/single_fetch.rs: fetch a single BMS difficulty table and print summary.examples/single_fetch_list.rs: fetch the table list once and print the first few items.examples/multi_fetch.rs: concurrently fetch multiple tables and print progress and results.
Docs & Links
docs.rs: https://docs.rs/bms-table- Repository: https://codeberg.org/brightmeows/bms-table-rs
License
Licensed under the Apache-2.0 license.