All Projects → pyropy → fastapi-socketio

pyropy / fastapi-socketio

Licence: Apache-2.0 license
Easily integrate socket.io with your FastAPI app 🚀

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to fastapi-socketio

ml gallery
This is a master project of some experiments with Neural Networks. Every project here is runnable, visualized and explained clearly.
Stars: ✭ 18 (-90.91%)
Mutual labels:  fastapi
openapi-python-client
Generate modern Python clients from OpenAPI
Stars: ✭ 543 (+174.24%)
Mutual labels:  fastapi
xQube
Boilerplate for realtime 3D rendering and server-side physics in HTML5 and NodeJS
Stars: ✭ 1 (-99.49%)
Mutual labels:  socketio
KivyMLApp
The repository host the API for the ML model via FastAPI, Flask and contains android app development files using KivyMD.
Stars: ✭ 54 (-72.73%)
Mutual labels:  fastapi
guane-intern-fastapi
FastAPI-PostgreSQL-Celery-RabbitMQ-Redis bakcend with Docker containerization
Stars: ✭ 54 (-72.73%)
Mutual labels:  fastapi
instagram-clone-frontend
📸 Um clone do instagram, onde você pode logar/registrar, criar novos posts, seguir outros usuários e ver os posts das pessoas que você segue.
Stars: ✭ 16 (-91.92%)
Mutual labels:  socketio
uno-online
Two player online game of UNO. Made using React and Socket.IO
Stars: ✭ 106 (-46.46%)
Mutual labels:  socketio
fastapi-health
Implement the Health Check API pattern on your FastAPI application! 🚀
Stars: ✭ 110 (-44.44%)
Mutual labels:  fastapi
Voice4Rural
A complete one stop solution for all the problems of Rural area people. 👩🏻‍🌾
Stars: ✭ 12 (-93.94%)
Mutual labels:  fastapi
fastapi-celery-redis-rabbitmq
A simple docker-compose app for orchestrating a fastapi application, a celery queue with rabbitmq(broker) and redis(backend)
Stars: ✭ 81 (-59.09%)
Mutual labels:  fastapi
fastapi
基于Fastapi开发,集成Celery-redis分布式任务队列、JWT 用户系统、ElasticSearch和encode orm的基础项目模板,大家可以根据自己的需求在本模板上进行修改
Stars: ✭ 75 (-62.12%)
Mutual labels:  fastapi
fastapi-async-mongodb
Simple example with FastAPI + MongoDB
Stars: ✭ 49 (-75.25%)
Mutual labels:  fastapi
asynction
SocketIO python framework driven by the AsyncAPI specification. Built on top of Flask-SocketIO. Inspired by Connexion.
Stars: ✭ 40 (-79.8%)
Mutual labels:  socketio
fastapi-mysql-generator
FastAPI + MySQL Web项目生成器 ,个人认为较为合理的项目组织结构;基于apscheduler的定时任务。
Stars: ✭ 348 (+75.76%)
Mutual labels:  fastapi
fastapi-redis
Showcase of Redis integration with Python FastAPI framework as API backend for RDKit: Open-Source Cheminformatics Software
Stars: ✭ 46 (-76.77%)
Mutual labels:  fastapi
image-background-remove-tool
✂️ Automated high-quality background removal framework for an image using neural networks. ✂️
Stars: ✭ 767 (+287.37%)
Mutual labels:  fastapi
Python-Studies
All studies about python
Stars: ✭ 56 (-71.72%)
Mutual labels:  fastapi
fastapi websocket pubsub
A fast and durable Pub/Sub channel over Websockets. FastAPI + WebSockets + PubSub == ⚡ 💪 ❤️
Stars: ✭ 255 (+28.79%)
Mutual labels:  fastapi
don-blog
一个基于Vue.js + Nuxt.js + SCSS + ES6/7 + Node.js + Koa.js + MySQL + Redis开发的个人博客。
Stars: ✭ 77 (-61.11%)
Mutual labels:  socketio
ecce
ML Prediction of Bible Topics and Passages (Python / React)
Stars: ✭ 36 (-81.82%)
Mutual labels:  fastapi

fastapi-socketio

PyPI Changelog License

Easly integrate socket.io with your FastAPI app.

Installation

Install this plugin using pip:

$ pip install fastapi-socketio

Usage

To add SocketIO support to FastAPI all you need to do is import SocketManager and pass it FastAPI object.

# app.py
from fastapi import FastAPI
from fastapi_socketio import SocketManager

app = FastAPI()
socket_manager = SocketManager(app=app)

Now you can use SocketIO directly from your FastAPI app object.

# socket_handlers.py
from .app import app

@app.sio.on('join')
async def handle_join(sid, *args, **kwargs):
    await app.sio.emit('lobby', 'User joined')

Or you can import SocketManager object that exposes most of the SocketIO functionality.

# socket_handlers2.py
from .app import socket_manager as sm

@sm.on('leave')
async def handle_leave(sid, *args, **kwargs):
    await sm.emit('lobby', 'User left')

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd fastapi-socketio
python -mvenv venv
source venv/bin/activate

Or if you are using pipenv:

pipenv shell

Now install the dependencies and tests:

pip install -e '.[test]'

To run the tests:

pytest

Run example

To run the examples simply run:

PYTHONPATH=. python examples/app.py

Before running example make sure you have all dependencies installed.

Contributors

For list of contributors please reefer to CONTRIBUTORS.md file in this repository.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].