Skip to main content

Python version info PyPI version info pre-commit.ci status Documentation Status pytest Status mypy Status Codacy Status

Simple and fast asynchronous osu! API v1 and v2 library with various utilities.

Features

  • Support for modern async syntax (async with)

  • Support for API v1 and API v2

  • Rate limit handling

  • Utilities for osu! related calculations

  • Easy to use

Installing

Python 3.10 or higher is required

To install the library, simply run the following commands

# Linux/macOS
python3 -m pip install -U aiosu

# Windows
py -3 -m pip install -U aiosu

To install the development version, do the following:

$ git clone https://github.com/NiceAesth/aiosu
$ cd aiosu
$ python3 -m pip install -U .

API v1 Example

import aiosu
import asyncio


async def main():
    # async with syntax
    async with aiosu.v1.Client("osu api token") as client:
        user = await client.get_user(7782553)

    # regular syntax
    client = aiosu.v1.Client("osu api token")
    user = await client.get_user(7782553)
    await client.aclose()


if __name__ == "__main__":
    asyncio.run(main())

API v2 Example

import aiosu
import asyncio
import datetime


async def main():
    token = aiosu.models.OAuthToken.model_validate(json_token_from_api)

    # or

    token = aiosu.models.OAuthToken(
        access_token="access token",
        refresh_token="refresh token",
        expires_on=datetime.datetime.utcnow()
        + datetime.timedelta(days=1),  # can also be string
    )

    # async with syntax
    async with aiosu.v2.Client(
        client_secret="secret", client_id=1000, token=token
    ) as client:
        user = await client.get_me()

    # regular syntax
    client = aiosu.v2.Client(client_secret="secret", client_id=1000, token=token)
    user = await client.get_me()
    await client.aclose()


if __name__ == "__main__":
    asyncio.run(main())

You can find more examples in the examples directory.

Contributing

Please read the CONTRIBUTING.rst to learn how to contribute to aiosu!

Acknowledgments

Release files for aiosu 2.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiosu 2.4.1
File Size Uploaded
aiosu-2.4.1.tar.gz 63.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiosu 2.4.1
File Interpreter ABI Platform
aiosu-2.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 144.9 kB

Release files / aiosu-2.4.1.tar.gz

Download URL aiosu-2.4.1.tar.gz
Size 63.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7c1f1e386085fdc3ac2ec18298104915bf8988351c76ca16b8d552613f37eb12
BLAKE2b-256 checksum
How to use checksums
f0090a4feaa84a5d783b2e4e459c6ceee0168b9f40d53479c680090946add9cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1018-azure

Release files / aiosu-2.4.1-py3-none-any.whl

Download URL aiosu-2.4.1-py3-none-any.whl
Size 81.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b8c2bbe94e02512e35ddc0fba0b3a2237415137a46ea3dd1234f9b3b8bd23b8
BLAKE2b-256 checksum
How to use checksums
6f12eae7dfe9bcba9b56a317a138c326005908ab7d0eae8ce94e6237ef408938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1018-azure

Release history Release notifications | RSS feed

2.5.1

2 release files

2.5.0

2 release files

This release

2.4.1 This release

2 release files

2.4.0

2 release files

2.3.6

2 release files

2.3.5

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page