Expand description
OsynicOsudb
π High Performance Β· ποΈ Well-Architected Β· π§ WASM Support
A feature-complete osu! database parser library that supports parsing osu!.db, collection.db, and scores.db.
π¨π³ Chinese Β· πΊπΈ English
Β§π Introduction
A high-performance osu! database parser library, reconstructed based on the excellent osu-db library. Supports all database file formats including osu!.db, collection.db, scores.db, and more, with full compatibility for osu! 2025+ versions.
Β§β¨ Features
- π High-performance parsing based on nom8 parser
- π¦ Support for all osu! database file formats
- π Complete WASM support (browser and Node.js)
- ποΈ Read-write separation design for easy maintenance
- π Strong type system ensures data safety
Β§π¦ Installation
Β§Rust
[dependencies]
osynic_osudb = "0.1.4"Β§JavaScript/TypeScript (via WASM)
npm install @osynicite/osynic-osudbor
yarn add @osynicite/osynic-osudbΒ§π Quick Start
Β§Rust Example
use osynic_osudb::entity::osu::osudb::OsuDB;
fn main() {
let mut osudb = OsuDB::from_file("osu!.db").unwrap();
for (index, beatmap) in osudb.beatmaps.iter_mut().take(3).enumerate() {
println!(
"Song {}: {} - {}",
index + 1,
beatmap.artist_unicode.as_ref().unwrap(),
beatmap.title_unicode.as_ref().unwrap()
);
println!("Creator: {}", beatmap.creator.as_ref().unwrap());
println!("Difficulty: {}", beatmap.difficulty_name.as_ref().unwrap());
println!("Audio: {}", beatmap.audio.as_ref().unwrap());
println!("Hash: {}", beatmap.hash.as_ref().unwrap());
println!("File Name: {}", beatmap.file_name.as_ref().unwrap());
println!("Status: {:?}", beatmap.status);
println!("Hitcircle Count: {}", beatmap.hitcircle_count);
println!("Slider Count: {}", beatmap.slider_count);
println!("Spinner Count: {}", beatmap.spinner_count);
println!("Last Modified: {}", beatmap.last_modified);
println!("Approach Rate: {}", beatmap.approach_rate);
println!("Circle Size: {}", beatmap.circle_size);
println!("HP Drain: {}", beatmap.hp_drain);
println!("Overall Difficulty: {}", beatmap.overall_difficulty);
println!("---------------------------------");
}
}Β§JavaScript/TypeScript Example
import { OsuDB } from '@osynicite/osynic-osudb';
async function main() {
const response = await fetch('osu!.db');
const buffer = await response.arrayBuffer();
const osudb = OsuDB.from_buffer(new Uint8Array(buffer));
osudb.beatmaps.slice(0, 3).forEach((beatmap, index) => {
console.log(`Song ${index + 1}: ${beatmap.artist_unicode} - ${beatmap.title_unicode}`);
console.log(`Creator: ${beatmap.creator}`);
console.log(`Difficulty: ${beatmap.difficulty_name}`);
console.log(`Hash: ${beatmap.hash}`);
console.log('---------------------------------');
});
}
main();π― More examples: Check the examples/ directory for complete examples, or run cargo run --example example_name to see the actual effect.
Β§π Documentation
Β§β€οΈ Acknowledgments
This project has been reconstructed based on the osu-db library with architectural optimizations, performance improvements, and version compatibility enhancements.
Special thanks to the authors of osu-db!
The osu-db project is based on Unlicense, and the project licenses are placed in the licenses/ directory.
Β§π€ Contribution Guidelines
Β§How to Contribute
We welcome PRs and Issues! If you discover any issues or have improvement suggestions, please follow these guidelines:
Β§Code Contribution Standards
- Coding Standards: Follow Rust official coding standards
- Testing Requirements: New features must include test cases
- Code Quality: Run
cargo fmtandcargo clippybefore submitting - Documentation Updates: Update relevant documentation and examples as needed
Β§Issue Submission Guidelines
- Describe the specific scenario of the problem
- Provide reproduction steps and error messages
- Include relevant API endpoints and parameters if applicable
Β§Development Setup
- Clone the repository:
git clone https://github.com/osynicite/osynic_osudb.git
cd osynic_osudb- Build the project:
cargo build- Run tests:
cargo test- Format code:
cargo fmt- Lint with clippy:
cargo clippy --all-targets --all-featuresΒ§π License
This project is open source under the MIT License. Please respect the original authorβs copyright.
Made with β€οΈ by the Osynicite team
For support, join us on Discord