https://github.com/khazhyk/osuapi
Simple osu api wrapper that I can use with both requests and aiohttp
https://github.com/khazhyk/osuapi
osu osu-api python3
Last synced: 6 months ago
JSON representation
Simple osu api wrapper that I can use with both requests and aiohttp
- Host: GitHub
- URL: https://github.com/khazhyk/osuapi
- Owner: khazhyk
- License: mit
- Created: 2016-03-31T21:01:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-06-14T17:22:43.000Z (over 2 years ago)
- Last Synced: 2025-03-23T19:16:11.073Z (7 months ago)
- Topics: osu, osu-api, python3
- Language: Python
- Homepage: http://osuapi.readthedocs.io/en/latest/index.html
- Size: 115 KB
- Stars: 16
- Watchers: 1
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
osuapi
======
[](https://pypi.python.org/pypi/osuapi/)
[](http://osuapi.readthedocs.io/en/latest/?badge=latest)Welcome to osssss!
osuapi a python wrapper for the osu! api.
It's "agnostic" of the requesting backend. Uses "connectors" to handle making requests and retrieving json.
Comes with `aiohttp` and `requests` implementations.Using with aiohttp
```py
from osuapi import OsuApi, AHConnector
import aiohttp
import asyncioasync def get_peppy_user_id():
api = OsuApi("mykey", connector=AHConnector())
results = await api.get_user("peppy")
return results[0].user_idresults = asyncio.get_event_loop().run_until_complete(get_peppy_user_id())
```Or requests
```py
from osuapi import OsuApi, ReqConnector
import requestsapi = OsuApi("mykey", connector=ReqConnector())
results = api.get_user("peppy")
```