sanic
A web server and web framework that's written to go fast. Build fast. Run fast.
What it is and what it does
Sanic is a web framework and server for Python 3.10+ designed around async/await syntax to build non-blocking, high-performance HTTP applications. It is ASGI-compliant, meaning you can deploy it with alternative ASGI servers if needed. The framework includes 11 runtime dependencies—notably sanic-routing for URL matching, httptools for HTTP parsing, uvloop for faster event loop execution, and ujson for faster JSON serialization—all of which can be toggled off at install time via environment variables if you prefer lighter dependencies.
The package is actively maintained by the community, with a recent release and an established user base. It targets developers building REST APIs, microservices, and real-time applications where request latency and throughput matter. The learning curve is shallow for anyone familiar with Flask or FastAPI, and the async-first design makes it natural to integrate with other async libraries.
Use it for:
- Build REST APIs and microservices that handle many concurrent requests with minimal latency.
- Create real-time applications (WebSocket support via websockets dependency) that need fast bidirectional communication.
- Deploy lightweight HTTP servers in containerized or serverless environments where startup time and memory footprint are constrained.
- Integrate async Python code (database drivers, external API calls) without blocking the request handler.
- Prototype or scale web applications where async/await patterns are already part of your codebase.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sanic is an async Python web framework and ASGI-compliant server built for high performance, using async/await syntax to handle requests without blocking.
Yes. Sanic is a solid choice for async Python web development. It has low install friction, active maintenance, no known vulnerabilities, permissive licensing, and a clear performance focus backed by a community-maintained project. Install it if you need an async web framework for Python 3.10+ and are comfortable with the 11 runtime dependencies—or if you want to exclude uvloop and ujson, set the environment variables at install time.
Install
sanic on PyPI
pip
pip install sanicuv
uv add sanicpoetry
poetry add sanicInstalling sanic
Before you install
Low install friction with a pure-wheel distribution. Active maintenance with a recent release (75 days ago) and ongoing community support. Requires Python 3.10+. Includes 11 runtime dependencies, notably uvloop and ujson for performance, both optional via environment variables at install time.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install sanic
from sanic import Sanic
from sanic.response import json
app = Sanic("my-app")
@app.route('/')
async def handler(request):
return json({'hello': 'world'})
# Run with: sanic my_app.app
Requires Python 3.10 or later. On Fedora 28+, redhat-rpm-config may be needed if using ujson.
Verify before relying
- Whether uvloop and ujson provide measurable performance gains for typical workloads compared to standard alternatives.
- How Sanic's performance scales under high concurrency relative to other async frameworks.
- Whether the 11 runtime dependencies introduce meaningful maintenance or security surface area over time.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — sanic-routing, httptools, uvloop, ujson, aiofiles, websockets, multidict, html5tagger, tracerite, typing-extensions, setuptools |
| Maintenance | actively maintained — 75 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,586,409/month — #3,738 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sanic-25.12.1-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
sanic-testingProvides sync and async test clients for…
permissive · top 15,000 on PyPI
granianGranian is a Rust-based HTTP server that runs…
permissive · top 5,000 on PyPI
sanic-extSanic Extensions adds OpenAPI documentation,…
permissive · top 15,000 on PyPI
Sanic-CorsSanic-CORS is a Sanic extension that adds…
permissive · top 15,000 on PyPI
multipartParses multipart/form-data submissions with…
permissive · top 5,000 on PyPI
sanic-routingSanic-routing is a low-level AST-style router…
permissive · top 5,000 on PyPI
uvicornUvicorn is an ASGI web server that runs async…
permissive · top 100 on PyPI
sanic-jwtSanic JWT adds JWT-based authentication and…
permissive · top 15,000 on PyPI
async-asgi-testclientProvides an async test client for ASGI web…
permissive · top 15,000 on PyPI
piccoloPiccolo is an async-first ORM and query builder…
permissive · top 15,000 on PyPI