osu


Nameosu JSON
Version 1.4.7 PyPI version JSON
download
home_pageNone
SummaryA python library that emulates the osu! stable client
upload_time2024-03-23 18:04:52
maintainerNone
docs_urlNone
authorLekuru
requires_pythonNone
licenseNone
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 anything that can happen to your account. If you want to test it out on a private 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] osu!direct
- [ ] Documentation
- [ ] Multiplayer

## 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/4c/22/9d784736b9f7c687f1b73f4573ccfb3870617023514538db8337536ae857/osu-1.4.7.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 anything that can happen to your account. If you want to test it out on a private 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] osu!direct\n- [ ] Documentation\n- [ ] Multiplayer\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.7",
    "project_urls": null,
    "split_keywords": [
        "osu",
        " osugame",
        " python",
        " bancho"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "652edc66bf97549e6c579ccc4d8c3e6c0b17f0b2fec66e9c369d8c208e7f2b2a",
                "md5": "3fbcf926da30e1b3f02462fa6422685c",
                "sha256": "9a5cd179f68917001f38dcd46d07dabc0cfa8089b11b387152c351a1a150d158"
            },
            "downloads": -1,
            "filename": "osu-1.4.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3fbcf926da30e1b3f02462fa6422685c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 39729,
            "upload_time": "2024-03-23T18:04:51",
            "upload_time_iso_8601": "2024-03-23T18:04:51.146085Z",
            "url": "https://files.pythonhosted.org/packages/65/2e/dc66bf97549e6c579ccc4d8c3e6c0b17f0b2fec66e9c369d8c208e7f2b2a/osu-1.4.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c229d784736b9f7c687f1b73f4573ccfb3870617023514538db8337536ae857",
                "md5": "c3d67e9bcf1c640918d953b722f19bc0",
                "sha256": "150fe003ecaa5c5a805ef128dabc9f02f8832a2d5457d199000c44057724cfb6"
            },
            "downloads": -1,
            "filename": "osu-1.4.7.tar.gz",
            "has_sig": false,
            "md5_digest": "c3d67e9bcf1c640918d953b722f19bc0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 33238,
            "upload_time": "2024-03-23T18:04:52",
            "upload_time_iso_8601": "2024-03-23T18:04:52.873747Z",
            "url": "https://files.pythonhosted.org/packages/4c/22/9d784736b9f7c687f1b73f4573ccfb3870617023514538db8337536ae857/osu-1.4.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-23 18:04:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "osu"
}
        
Elapsed time: 0.20825s