skillfed

sanic

A web server and web framework that's written to go fast. Build fast. Run fast.

sanic v25.12.1 1.6M downloads/30d#3,738 on PyPI18,646
Permissive license MIT Active released

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 sanic

uv

uv add sanic

poetry

poetry add sanic

Installing 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

Development Status :: 4 - BetaEnvironment :: Web EnvironmentLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

async python web frameworkfast asgi web serverpython 3.10 async http servernon-blocking web frameworkhigh performance python webasync request handlingpython async web development
async-firstasgi-complianthigh-performance

More Application Frameworks packages