A python library that emulates the osu! stable client
Project description
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
- Receiving player stats
- Sending/Receiving chat messages
- Spectating
- Avatars
- Comments
- Replays
- Scores/Leaderboards
- Tournament client behaviour
- Direct Search
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osu-1.4.14.tar.gz.
File metadata
- Download URL: osu-1.4.14.tar.gz
- Upload date:
- Size: 34.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
090b40ddcc4728003b51f85ec210d7d096528c1b99031c372039b4a17e2d435d
|
|
| MD5 |
fc6b5a1df4d73e9f97bddcf589697441
|
|
| BLAKE2b-256 |
6e5872532635546bc9f93c2f634aa279572ef62d9942889b2d971d6dea38356c
|
File details
Details for the file osu-1.4.14-py3-none-any.whl.
File metadata
- Download URL: osu-1.4.14-py3-none-any.whl
- Upload date:
- Size: 41.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eff68d810fa3be1e7627c545419ea62f4592ade9d3d5a9dcd75b4d853786872a
|
|
| MD5 |
8870f0643d2cc6aa0b7aa5c1333dfd8c
|
|
| BLAKE2b-256 |
04132a1a7f6b316c80f1d61637b4ec846884644f8d3fb3b8ee6adc950031834b
|