Osu.py
A python library that emulates the osu! stable client
Install / Use
/learn @Lekuruu/Osu.pyREADME
osu.py
osu.py is a python library that emulates part of the online functionality of the osu! stable client.
IMPORTANT:
Use this library at your own risk! I am not responsible for any unexpected behavior of the client or anything that can happen to your account. If you want to test it out on a custom server, you can set the server attribute when initializing the client.
You can install this package with pip:
pip install osu
Or build it manually:
git clone https://github.com/Lekuruu/osu.py.git
cd osu.py
pip install setuptools
python setup.py install
Features
- [x] Receiving player stats
- [x] Sending/Receiving chat messages
- [x] Spectating
- [x] Avatars
- [x] Comments
- [x] Replays
- [x] Scores/Leaderboards
- [x] Tournament client behaviour
- [x] Direct Search
- [x] Direct Download
- [ ] Multiplayer
- [ ] Documentation
Example
Here is a small example of how to use this package:
from osu.bancho.constants import ServerPackets
from osu.objects import Player
from osu import Game
import logging
# Enable extended logging
logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s] - <%(name)s> %(levelname)s: %(message)s'
)
# Initialize the game class
game = Game(
USERNAME,
PASSWORD
)
# Simple message handler
@game.events.register(ServerPackets.SEND_MESSAGE)
def on_message(sender: Player, message: str, target: Player):
if message.startswith('?ping'):
sender.send_message('pong!')
# Run the game
game.run()
You can also run tasks, independent of server actions:
# Example of a task, running every minute
@game.tasks.register(minutes=1, loop=True)
def example_task():
...
For a more in-depth example, please view this project.
If you have any questions, feel free to contact me on discord: lekuru
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
108.0kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
347.2kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
