{"id":13424741,"url":"https://github.com/pyropy/fastapi-socketio","last_synced_at":"2025-03-15T18:35:50.523Z","repository":{"id":37822724,"uuid":"294731010","full_name":"pyropy/fastapi-socketio","owner":"pyropy","description":"Easily integrate socket.io with your FastAPI app 🚀","archived":true,"fork":false,"pushed_at":"2023-11-26T03:02:26.000Z","size":34,"stargazers_count":333,"open_issues_count":23,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T22:03:56.208Z","etag":null,"topics":["fastapi","fastapi-socketio","python","socketio","websocket"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyropy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-09-11T15:22:31.000Z","updated_at":"2025-02-11T21:35:07.000Z","dependencies_parsed_at":"2024-01-03T02:30:08.111Z","dependency_job_id":"8704e54b-3fd1-402a-bdee-0fb0f2c6a372","html_url":"https://github.com/pyropy/fastapi-socketio","commit_stats":{"total_commits":32,"total_committers":7,"mean_commits":4.571428571428571,"dds":0.21875,"last_synced_commit":"14fd23ae6447c912422506e0dfcbd0a888e152c8"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyropy%2Ffastapi-socketio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyropy%2Ffastapi-socketio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyropy%2Ffastapi-socketio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyropy%2Ffastapi-socketio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyropy","download_url":"https://codeload.github.com/pyropy/fastapi-socketio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775916,"owners_count":20346286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","fastapi-socketio","python","socketio","websocket"],"created_at":"2024-07-31T00:00:58.669Z","updated_at":"2025-03-15T18:35:45.506Z","avatar_url":"https://github.com/pyropy.png","language":"Python","readme":"# fastapi-socketio\n\n[![PyPI](https://img.shields.io/pypi/v/fastapi-socketio.svg)](https://pypi.org/project/fastapi-socketio/)\n[![Changelog](https://img.shields.io/github/v/release/pyropy/fastapi-socketio?label=changelog)](https://github.com/pyropy/fastapi-socketio/releases)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/pyropy/fastapi-socketio/blob/main/LICENSE)\n\nEasly integrate socket.io with your FastAPI app.\n\n## Installation\n\nInstall this plugin using `pip`:\n\n    $ pip install fastapi-socketio\n\n## Usage\n\nTo add SocketIO support to FastAPI all you need to do is import `SocketManager` and pass it `FastAPI` object.\n\n```python\n# app.py\nfrom fastapi import FastAPI\nfrom fastapi_socketio import SocketManager\n\napp = FastAPI()\nsocket_manager = SocketManager(app=app)\n```\n\n\nNow you can use SocketIO directly from your `FastAPI` app object.\n```python\n# socket_handlers.py\nfrom .app import app\n\n@app.sio.on('join')\nasync def handle_join(sid, *args, **kwargs):\n    await app.sio.emit('lobby', 'User joined')\n\n```\n\nOr you can import `SocketManager` object that exposes most of the SocketIO functionality.\n\n```python\n# socket_handlers2.py\nfrom .app import socket_manager as sm\n\n@sm.on('leave')\nasync def handle_leave(sid, *args, **kwargs):\n    await sm.emit('lobby', 'User left')\n\n```\n\n## Development\n\nTo contribute to this library, first checkout the code. Then create a new virtual environment:\n\n    cd fastapi-socketio\n    python -mvenv venv\n    source venv/bin/activate\n\nOr if you are using `pipenv`:\n\n    pipenv shell\n\nNow install the dependencies and tests:\n\n    pip install -e '.[test]'\n\nTo run the tests:\n\n    pytest\n\n\n## Run example\n\nTo run the examples simply run:\n\n```bash\nPYTHONPATH=. python examples/app.py\n```\n\nBefore running example make sure you have all dependencies installed.\n\n## Contributors\n\nFor list of contributors please reefer to CONTRIBUTORS.md file in this repository.","funding_links":[],"categories":["Third-Party Extensions","Python"],"sub_categories":["Utils"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyropy%2Ffastapi-socketio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyropy%2Ffastapi-socketio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyropy%2Ffastapi-socketio/lists"}