khazhyk / osuapi

Simple osu api wrapper that I can use with both requests and aiohttp

Home Page:http://osuapi.readthedocs.io/en/latest/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

osuapi

pip Documentation Status

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

from osuapi import OsuApi, AHConnector
import aiohttp
import asyncio

async def get_peppy_user_id():
	api = OsuApi("mykey", connector=AHConnector())
	results = await api.get_user("peppy")
	return results[0].user_id

results = asyncio.get_event_loop().run_until_complete(get_peppy_user_id())

Or requests

from osuapi import OsuApi, ReqConnector
import requests

api = OsuApi("mykey", connector=ReqConnector())
results = api.get_user("peppy")

About

Simple osu api wrapper that I can use with both requests and aiohttp

http://osuapi.readthedocs.io/en/latest/index.html

License:MIT License


Languages

Language:Python 100.0%