Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The definitive python wrapper for MaimaiCN. 用于国服舞萌相关开发的最佳Python工具库, 封装水鱼/落雪查分器常用函数.

License

NotificationsYou must be signed in to change notification settings

TrueRou/maimai.py

Repository files navigation

PyPI versionLicensePython versionszh

maimai.py

The definitive python wrapper for MaimaiCN related development, wrapping the frequently used methods from DivingFish and LXNS.

We provide data models and methods based on MaiMai standard, and make implementation for both DivingFish and LXNS.

Support querying songs, player information, scores, ratings, name plates from any data sources.

In addition, we support getting player scores with WeChat OpenID, parsing the score HTML, and uploading it to the data sources.

Installation

pip install maimai-py

To upgrade:

pip install -U maimai-py

For more, read the docs:https://maimai.turou.fun/.

Additionally, you candownload the maimai.py client and develop using any programming language.

Quickstart

importasynciofrommaimai_pyimportMaimaiClient,MaimaiPlates,MaimaiScores,MaimaiSongs,PlayerIdentifier,LXNSProvider,DivingFishProviderasyncdefquick_start():maimai=MaimaiClient()divingfish=DivingFishProvider(developer_token="")# fetch all songs and their metadatasongs:MaimaiSongs=awaitmaimai.songs()# fetch divingfish user turou's scores (b50 scores by default)scores:MaimaiScores=awaitmaimai.scores(PlayerIdentifier(username="turou"),provider=divingfish)# fetch divingfish user turou's 舞将 plate informationplates:MaimaiPlates=awaitmaimai.plates(PlayerIdentifier(username="turou"),"舞将",provider=divingfish)song=songs.by_id(1231)# 生命不詳 by 蜂屋ななしprint(f"Song 1231:{song.artist} -{song.title}")print(f"TuRou's rating:{scores.rating}, b15 top rating:{scores.scores_b15[0].dx_rating}")print(f"TuRou's 舞将:{plates.cleared_num}/{plates.all_num} cleared")asyncio.run(quick_start())

Async

maimai.py is fully asynchronous by default, and there are no plans to provide synchronous methods.

If you don't want to be asynchronous, you can use theasyncio.run wrapper to call asynchronous methods synchronously.

Client

maimai.py provides a RESTful API client, which you can call maimai.py features via HTTP requests from any language.

The client is compiled using Nuitka, please download it from theReleases page.

Our client supports Windows and Linux, please download the corresponding version according to your system.

For the client API documentation, please see:https://openapi.maimai.turou.fun/.

About

The definitive python wrapper for MaimaiCN. 用于国服舞萌相关开发的最佳Python工具库, 封装水鱼/落雪查分器常用函数.

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp