aiosu


Nameaiosu JSON
Version 2.3.1 PyPI version JSON
download
home_pagehttps://github.com/NiceAesth/aiosu
SummarySimple and fast osu! API v1 and v2 library
upload_time2024-04-10 14:25:30
maintainerNone
docs_urlNone
authorNice Aesthetics
requires_python<4.0,>=3.9
licenseGPLv3+
keywords osu! osu api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            aiosu
=====

|Python| |pypi| |pre-commit.ci status| |rtd| |pytest| |mypy| |codacy|

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.9 or higher is required**

To install the library, simply run the following commands

.. code:: sh

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

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

To install the development version, do the following:

.. code:: sh

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


API v1 Example
--------------

.. code:: py

   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
--------------

.. code:: py

    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 <.github/CONTRIBUTING.rst>`__ to learn how to contribute to aiosu!


Acknowledgments
---------------

-  `discord.py <https://github.com/Rapptz/discord.py>`__
   for README formatting
-  `osu!Akatsuki <https://github.com/osuAkatsuki/performance-calculator>`__
   for performance and accuracy utils


.. |Python| image:: https://img.shields.io/pypi/pyversions/aiosu.svg
    :target: https://pypi.python.org/pypi/aiosu
    :alt: Python version info
.. |pypi| image:: https://img.shields.io/pypi/v/aiosu.svg
    :target: https://pypi.python.org/pypi/aiosu
    :alt: PyPI version info
.. |pre-commit.ci status| image:: https://results.pre-commit.ci/badge/github/NiceAesth/aiosu/master.svg
    :target: https://results.pre-commit.ci/latest/github/NiceAesth/aiosu/master
    :alt: pre-commit.ci status
.. |pytest| image:: https://github.com/NiceAesth/aiosu/actions/workflows/pytest.yml/badge.svg
    :target: https://github.com/NiceAesth/aiosu/actions/workflows/pytest.yml
    :alt: pytest Status
.. |mypy| image:: https://github.com/NiceAesth/aiosu/actions/workflows/mypy.yml/badge.svg
    :target: https://github.com/NiceAesth/aiosu/actions/workflows/mypy.yml
    :alt: mypy Status
.. |rtd| image:: https://readthedocs.org/projects/aiosu/badge/?version=latest
    :target: https://aiosu.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status
.. |codacy| image:: https://app.codacy.com/project/badge/Grade/9bf211d7e29546dc99cc0b1a3d89b291
    :target: https://app.codacy.com/gh/NiceAesth/aiosu/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=NiceAesth/aiosu&amp;utm_campaign=Badge_Grade
    :alt: Codacy Status

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NiceAesth/aiosu",
    "name": "aiosu",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "osu!, osu, api",
    "author": "Nice Aesthetics",
    "author_email": "nice@aesth.dev",
    "download_url": "https://files.pythonhosted.org/packages/6e/57/e99ab2ee199769f247ca81c5ec0cacf83ac0c21a13a0a8c899db17d840a5/aiosu-2.3.1.tar.gz",
    "platform": null,
    "description": "aiosu\n=====\n\n|Python| |pypi| |pre-commit.ci status| |rtd| |pytest| |mypy| |codacy|\n\nSimple and fast asynchronous osu! API v1 and v2 library with various utilities.\n\n\nFeatures\n--------\n\n- Support for modern async syntax (async with)\n- Support for API v1 and API v2\n- Rate limit handling\n- Utilities for osu! related calculations\n- Easy to use\n\n\nInstalling\n----------\n\n**Python 3.9 or higher is required**\n\nTo install the library, simply run the following commands\n\n.. code:: sh\n\n    # Linux/macOS\n    python3 -m pip install -U aiosu\n\n    # Windows\n    py -3 -m pip install -U aiosu\n\nTo install the development version, do the following:\n\n.. code:: sh\n\n    $ git clone https://github.com/NiceAesth/aiosu\n    $ cd aiosu\n    $ python3 -m pip install -U .\n\n\nAPI v1 Example\n--------------\n\n.. code:: py\n\n   import aiosu\n   import asyncio\n\n\n   async def main():\n       # async with syntax\n       async with aiosu.v1.Client(\"osu api token\") as client:\n           user = await client.get_user(7782553)\n\n       # regular syntax\n       client = aiosu.v1.Client(\"osu api token\")\n       user = await client.get_user(7782553)\n       await client.aclose()\n\n\n   if __name__ == \"__main__\":\n       asyncio.run(main())\n\n\nAPI v2 Example\n--------------\n\n.. code:: py\n\n    import aiosu\n    import asyncio\n    import datetime\n\n\n    async def main():\n        token = aiosu.models.OAuthToken.model_validate(json_token_from_api)\n\n        # or\n\n        token = aiosu.models.OAuthToken(\n            access_token=\"access token\",\n            refresh_token=\"refresh token\",\n            expires_on=datetime.datetime.utcnow()\n            + datetime.timedelta(days=1),  # can also be string\n        )\n\n        # async with syntax\n        async with aiosu.v2.Client(\n            client_secret=\"secret\", client_id=1000, token=token\n        ) as client:\n            user = await client.get_me()\n\n        # regular syntax\n        client = aiosu.v2.Client(client_secret=\"secret\", client_id=1000, token=token)\n        user = await client.get_me()\n        await client.aclose()\n\n\n    if __name__ == \"__main__\":\n        asyncio.run(main())\n\n\nYou can find more examples in the examples directory.\n\n\nContributing\n------------\n\nPlease read the `CONTRIBUTING.rst <.github/CONTRIBUTING.rst>`__ to learn how to contribute to aiosu!\n\n\nAcknowledgments\n---------------\n\n-  `discord.py <https://github.com/Rapptz/discord.py>`__\n   for README formatting\n-  `osu!Akatsuki <https://github.com/osuAkatsuki/performance-calculator>`__\n   for performance and accuracy utils\n\n\n.. |Python| image:: https://img.shields.io/pypi/pyversions/aiosu.svg\n    :target: https://pypi.python.org/pypi/aiosu\n    :alt: Python version info\n.. |pypi| image:: https://img.shields.io/pypi/v/aiosu.svg\n    :target: https://pypi.python.org/pypi/aiosu\n    :alt: PyPI version info\n.. |pre-commit.ci status| image:: https://results.pre-commit.ci/badge/github/NiceAesth/aiosu/master.svg\n    :target: https://results.pre-commit.ci/latest/github/NiceAesth/aiosu/master\n    :alt: pre-commit.ci status\n.. |pytest| image:: https://github.com/NiceAesth/aiosu/actions/workflows/pytest.yml/badge.svg\n    :target: https://github.com/NiceAesth/aiosu/actions/workflows/pytest.yml\n    :alt: pytest Status\n.. |mypy| image:: https://github.com/NiceAesth/aiosu/actions/workflows/mypy.yml/badge.svg\n    :target: https://github.com/NiceAesth/aiosu/actions/workflows/mypy.yml\n    :alt: mypy Status\n.. |rtd| image:: https://readthedocs.org/projects/aiosu/badge/?version=latest\n    :target: https://aiosu.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n.. |codacy| image:: https://app.codacy.com/project/badge/Grade/9bf211d7e29546dc99cc0b1a3d89b291\n    :target: https://app.codacy.com/gh/NiceAesth/aiosu/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=NiceAesth/aiosu&amp;utm_campaign=Badge_Grade\n    :alt: Codacy Status\n",
    "bugtrack_url": null,
    "license": "GPLv3+",
    "summary": "Simple and fast osu! API v1 and v2 library",
    "version": "2.3.1",
    "project_urls": {
        "Documentation": "https://aiosu.readthedocs.io/",
        "Homepage": "https://github.com/NiceAesth/aiosu",
        "Repository": "https://github.com/NiceAesth/aiosu"
    },
    "split_keywords": [
        "osu!",
        " osu",
        " api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4f3cfe30f7a9c10544570f1a19b3ad7a38ab4ac0f2b96329712b80f175724cd",
                "md5": "129d852f29cda5e13ea116e9ed40795d",
                "sha256": "17c4f8e89280059f034fb4731479939c115c00f3e7dd31c74e44d3b77ae8e1da"
            },
            "downloads": -1,
            "filename": "aiosu-2.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "129d852f29cda5e13ea116e9ed40795d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 79616,
            "upload_time": "2024-04-10T14:25:28",
            "upload_time_iso_8601": "2024-04-10T14:25:28.888422Z",
            "url": "https://files.pythonhosted.org/packages/d4/f3/cfe30f7a9c10544570f1a19b3ad7a38ab4ac0f2b96329712b80f175724cd/aiosu-2.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e57e99ab2ee199769f247ca81c5ec0cacf83ac0c21a13a0a8c899db17d840a5",
                "md5": "8a8c80aa75309af225e789398a94ae9d",
                "sha256": "4492583687a5c62495606142fd7a8dd9e493bcdb66aa26610f15d55a455869be"
            },
            "downloads": -1,
            "filename": "aiosu-2.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8a8c80aa75309af225e789398a94ae9d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 63263,
            "upload_time": "2024-04-10T14:25:30",
            "upload_time_iso_8601": "2024-04-10T14:25:30.442027Z",
            "url": "https://files.pythonhosted.org/packages/6e/57/e99ab2ee199769f247ca81c5ec0cacf83ac0c21a13a0a8c899db17d840a5/aiosu-2.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 14:25:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NiceAesth",
    "github_project": "aiosu",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiosu"
}
        
Elapsed time: 0.25918s