Skip to main content

aiosu

Python version info PyPI version info pre-commit.ci status Documentation Status pytest Status mypy 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.12 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.now(datetime.UTC)
        + 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

Metadata

Release files for aiosu 3.0.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 3.0.1
File Size Uploaded Provenance Actions
aiosu-3.0.1.tar.gz 80.3 kB Without provenance Details for aiosu-3.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 183.9 kB

Release files / aiosu-3.0.1.tar.gz

Download URL aiosu-3.0.1.tar.gz
Size 80.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b6169f4bc9fb76f931b7a9c70087a0b1cc89b34b61a6e4be17ebaca05b24e3d7
BLAKE2b-256 checksum
How to use checksums
1f19d10c6ed03bf13bc584344331827dc20c478a666a8312f79d0b2e701ec2c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.16 Linux/7.0.0-1019-azure

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

Download URL aiosu-3.0.1-py3-none-any.whl
Size 103.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e5cc6506d6344fa21f63310e0a69902e3ca7c200118f67953cee9e24bfcbd8b
BLAKE2b-256 checksum
How to use checksums
24ff4e8256a350a4720b460598664ecd13e3072c793b3f1104f6387104ee8f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.16 Linux/7.0.0-1019-azure

Security for aiosu 3.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files No provenance

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