Name | osu JSON |
Version |
1.4.11
JSON |
| download |
home_page | None |
Summary | A python library that emulates the osu! stable client |
upload_time | 2024-12-01 20:20:20 |
maintainer | None |
docs_url | None |
author | Lekuru |
requires_python | None |
license | None |
keywords |
osu
osugame
python
bancho
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# osu.py
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/Lekuruu/osu.py/blob/main/LICENSE)
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:
```shell
pip install osu
```
Or build it manually:
```shell
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:
```python
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:
```python
# Example of a task, running every minute
@game.tasks.register(minutes=1, loop=True)
def example_task():
...
```
You can also run this project with asyncio:
```shell
pip install asyncio
```
```python
import asyncio
game = Game(
USERNAME,
PASSWORD
)
# Run the game
asyncio.run(game.run_async())
```
For a more in-depth example, please view [this project](https://github.com/lekuruu/osu-recorder).
---
If you have any questions, feel free to contact me on discord: `lekuru`
Raw data
{
"_id": null,
"home_page": null,
"name": "osu",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "osu, osugame, python, bancho",
"author": "Lekuru",
"author_email": "contact@lekuru.xyz",
"download_url": "https://files.pythonhosted.org/packages/a4/49/95a05d50063bc4aed6c72142b206af66d2da55ee057b60de5f0f4678b6bd/osu-1.4.11.tar.gz",
"platform": null,
"description": "# osu.py\n\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)\n[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/Lekuruu/osu.py/blob/main/LICENSE)\n\nosu.py is a python library that emulates part of the online functionality of the osu! stable client.\n\n**IMPORTANT:**\nUse 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.\n\nYou can install this package with pip:\n\n```shell\npip install osu\n```\n\nOr build it manually:\n\n```shell\ngit clone https://github.com/Lekuruu/osu.py.git\ncd osu.py\npip install setuptools\npython setup.py install\n```\n\n## Features\n\n- [x] Receiving player stats\n- [x] Sending/Receiving chat messages\n- [x] Spectating\n- [x] Avatars\n- [x] Comments\n- [x] Replays\n- [x] Scores/Leaderboards\n- [x] Tournament client behaviour\n- [x] Direct Search\n- [x] Direct Download\n- [ ] Multiplayer\n- [ ] Documentation\n\n## Example\n\nHere is a small example of how to use this package:\n\n```python\nfrom osu.bancho.constants import ServerPackets\nfrom osu.objects import Player\nfrom osu import Game\nimport logging\n\n# Enable extended logging\nlogging.basicConfig(\n level=logging.INFO,\n format='[%(asctime)s] - <%(name)s> %(levelname)s: %(message)s'\n)\n\n# Initialize the game class\ngame = Game(\n USERNAME,\n PASSWORD\n)\n\n# Simple message handler\n@game.events.register(ServerPackets.SEND_MESSAGE)\ndef on_message(sender: Player, message: str, target: Player):\n if message.startswith('?ping'):\n sender.send_message('pong!')\n\n# Run the game\ngame.run()\n```\n\nYou can also run tasks, independent of server actions:\n\n```python\n# Example of a task, running every minute\n@game.tasks.register(minutes=1, loop=True)\ndef example_task():\n ...\n```\n\nYou can also run this project with asyncio:\n\n```shell\npip install asyncio\n```\n\n```python\nimport asyncio\n\ngame = Game(\n USERNAME,\n PASSWORD\n)\n\n# Run the game\nasyncio.run(game.run_async())\n```\n\nFor a more in-depth example, please view [this project](https://github.com/lekuruu/osu-recorder).\n\n---\n\nIf you have any questions, feel free to contact me on discord: `lekuru`\n",
"bugtrack_url": null,
"license": null,
"summary": "A python library that emulates the osu! stable client",
"version": "1.4.11",
"project_urls": null,
"split_keywords": [
"osu",
" osugame",
" python",
" bancho"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "89d594c84924f4541e9379b2a14975e2f76e11a2a8b1617f101f6839e4ec15c1",
"md5": "7c91fcf8253f13a1be5f686bc90d87b3",
"sha256": "eacd93fe7982d7f9d847b5111f947195750d633ed6c3afda5afe8ea689092cc7"
},
"downloads": -1,
"filename": "osu-1.4.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7c91fcf8253f13a1be5f686bc90d87b3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 40201,
"upload_time": "2024-12-01T20:20:19",
"upload_time_iso_8601": "2024-12-01T20:20:19.157242Z",
"url": "https://files.pythonhosted.org/packages/89/d5/94c84924f4541e9379b2a14975e2f76e11a2a8b1617f101f6839e4ec15c1/osu-1.4.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a44995a05d50063bc4aed6c72142b206af66d2da55ee057b60de5f0f4678b6bd",
"md5": "1337c13ce246751ab483312b93560e19",
"sha256": "9b01a89aedd16cf6dc995560ffc877dfd236ce40abdaa0797fe38502bb528774"
},
"downloads": -1,
"filename": "osu-1.4.11.tar.gz",
"has_sig": false,
"md5_digest": "1337c13ce246751ab483312b93560e19",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33522,
"upload_time": "2024-12-01T20:20:20",
"upload_time_iso_8601": "2024-12-01T20:20:20.190183Z",
"url": "https://files.pythonhosted.org/packages/a4/49/95a05d50063bc4aed6c72142b206af66d2da55ee057b60de5f0f4678b6bd/osu-1.4.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-01 20:20:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "osu"
}