Metadata-Version: 2.1
Name: fastapi-misskey
Version: 0.0.1
Summary: Misskey authentication to FastAPI
Home-page: https://github.com/yupix/fastapi-misskey
Author: yupix
License: MIT
Keywords: misskey,fastapi
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: aiocache (==0.11.1)
Requires-Dist: aiohttp (==3.8.1)
Requires-Dist: fastapi (==0.70.0)
Requires-Dist: uvicorn (==0.15.0)

# FastAPI Misskey

このライブラリはFastAPIにMisskeyの認証を作成するお手伝いをするライブラリです

## Example

```python
from typing import Optional

from fastapi import Depends, FastAPI

from fastapi_misskey.client import MisskeyAuthClient

app = FastAPI()
misskey = MisskeyAuthClient(
    'https://example.com',
    'test',
    'http://localhost:8000/callback',
    description='FastAPI Misskey Auth'
)


@app.get('/login')
async def login():
    return {'url': await misskey.get_auth_url()}


@app.get('/callback')
async def callback(session: Optional[str] = None, token: Optional[str] = None):
    token, user = await misskey.get_access_token(session, token)
    return {'token': token, 'user': user}


@app.get('/profile')
async def profile(user=Depends(misskey.get_user)):
    if user.get('error'):
        return user
    else:
        return {'user': user}

```

## Inspired by

[fastapi-discord](https://github.com/Tert0/fastapi-discord)

Thanks to @Tert0

