Misskey is a decentralized platform.

Misskey is just a platform for server owners to make their own instances of Misskey, and they can all talk to each other! There's large instances for the masses, smaller ones for groups, fandoms, and subcultures, and even instances just for individuals and their friends. Want to have even more control? You can make your own instance on your server with relative ease, cutting ties from any large company who wants to spy on you and sell your data. Misskey is about community and sharing, not corporations and big tech. Have friends not on Misskey? No problem! Because Misskey is on the Fediverse (ActivityPub), you can interact with people on other platforms like Mastodon, PixelFed, PeerTube, and more!

install 

pip install fastapi-misskey

Example

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}

keywords: FastAPI