GithubHelp home page GithubHelp logo

maimai-search-rs's Introduction

maimai-search-rs

使用 maimaidxprober 的 json 数据的命令行小工具

数据来源舞萌 DX 查分器,感谢大佬提供的 API 接口与数据

主要的功能是查找歌曲的难度,以及查找难度的歌曲,由于本人是 Rust 初学者,故从自己的需求入手写一个小工具,仅支持命令行模式请求

注意事项

项目使用了 Tantivy 搜索引擎

Tantivy是Rust实现的本地搜索库,功能对标 lucene,该库的优点在于纯 Rust 实现,性能高(lucene 的2-3倍),资源占用低,社区活跃。

在 MacOS 与 Linux/UNIX 平台上遵守 XDG 规范,数据库与配置文件均放置于 ~/.config/maimai-search 路径下

可以选择把本程序放置于 PATH 下,或者在使用时指定路径

主要功能

更新歌曲数据

只要在使用前运行一次即可,不需要每次都运行

maimai-search update

通过添加--md参数可以将歌曲信息输出为 Markdown 表格

B50 图片绘制

这部分复刻了 mai-bot 的图片绘制功能,将 Python 的Pillow库替换为了 Rust 的images库与imageproc库,以此实现了绘制性能的提升

B50

生成这张图片的示例代码在examples/b50.rs

TODO:

推分 list

添加推分 list 功能,可以将自己的推分列表导入到数据库中

maimai-search-rs's People

Contributors

anselyuki avatar teachertan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

teachertan

maimai-search-rs's Issues

Maybe have problems in pyo3 in Windows

In README.md in pyo3 in github, there are some prepared notice:

To embed Python into a Rust binary, you need to ensure that your Python installation contains a shared library. The following steps demonstrate how to ensure this (for Ubuntu), and then give some example code which runs an embedded Python interpreter.
To install the Python shared library on Ubuntu:
sudo apt install python3-dev

(在pyo3的官方仓库里,有提及到若需要在RUST中使用python模块,需要先安装python3-dev这个共享库,我不确定在Windows上这个共享库是否原生存在。前提:使用 pip3 install python3-dev 是无效的)

B50绘图功能使用Pyo3调用

目前pyo3调试已经成功,需要在本地设置python的全局变量以供pyo3初始化

  • @Anselyuki Pyo3本地调试
  • @Anselyuki Action的编译调试
  • @Anselyuki 提供给Python调用的FFI接口
  • @TeacherTan 使用pyo3的方式在Rust中调用Class DarwBest,可以先使用桩模块进行实现(暂时不创建CLI参数,使用tests运行)

Markdown生成调整

为了Markdown编辑方便,希望增加一个参数加入多个id,生成一个乐曲列表包含多行乐曲信息。
示例:

./maimai-search.exe -list 480 11233 11207 466 -m -o Demo.md
谱面图片 ID 乐曲标题 类型 分区 BPM 演唱/作曲
HIMITSUスパーク 480 HIMITSUスパーク SD 流行&动漫 156 カラスは真っ白
Starry Colors 11233 Starry Colors DX 舞萌 177 BlackY feat. Risa Yuzuki
Ether Strike 11207 Ether Strike DX 其他游戏 156 Akira Complex
Jimang Shot 466 Jimang Shot SD 东方Project 164 じまんぐ

About --help

是否可以将 --help 界面中直接加入 search 命令下的参数配置,例如:

search 搜索谱面信息,如果同时传入 id 参数与 name 参数,将优先使用 id 进行精确查询
    --id / -i ID参数
    --name/ -n Name参数  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.