bms-table 0.14.0

BMS (Be-Music Source) difficulty table parser
Documentation

BMS Difficulty Table Parsing Library

Codeberg Crates.io Documentation License: Apache-2.0 Downloads

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 in extra.
  • Parse chart data into BmsTableData, supporting a plain array of ChartItem structure.
  • Automatically convert md5/sha256 lists in courses to ChartItem; level defaults to "0".

API Overview

  • BmsTable: top-level data structure containing header and data.
  • BmsTableHeader: header metadata; unrecognized fields are preserved in extra.
  • BmsTableData: chart data as an array.
  • CourseGroup: recursive course tree supporting arbitrary nesting depth (Courses leaf / SubGroups branch).
  • CourseInfo: course information; supports automatically converting md5/sha256 lists to chart items.
  • ChartItem: a chart entry; spec-defined fields plus extra for forward compatibility.
  • Trophy: trophy requirements (max miss rate, minimum score rate).
  • BmsTableInfo / BmsTableList: data types for difficulty table list JSON.
  • BmsTableHtml: HTML parsing operations; see extract_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

License

Licensed under the Apache-2.0 license.