All Projects → sanic-org → Sanic

sanic-org / Sanic

Licence: mit
Async Python 3.7+ web server/framework | Build fast. Run fast.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sanic

nardis
A small web framework based on ASGI
Stars: ✭ 14 (-99.91%)
Mutual labels:  web-framework, asyncio, asgi
Ego
Ego is a full-stack web framework written in Go, lightweight and efficient front-end component solutions, based on gin. The front-end is compiled, does not affect the back-end.
Stars: ✭ 185 (-98.82%)
Mutual labels:  framework, web-framework
Aero
🚄 Fastest node.js framework. Go version is actively maintained: @aerogo
Stars: ✭ 181 (-98.84%)
Mutual labels:  framework, web-server
Catacumba
Asynchronous web toolkit for clojure built on top of Ratpack / Netty
Stars: ✭ 192 (-98.77%)
Mutual labels:  web-framework, web-server
Webgo
A minimal framework to build web apps; with handler chaining, middleware support; and most of all standard library compliant HTTP handlers(i.e. http.HandlerFunc).
Stars: ✭ 165 (-98.95%)
Mutual labels:  api-server, web-framework
Owllook
owllook-小说搜索引擎
Stars: ✭ 2,163 (-86.19%)
Mutual labels:  asyncio, sanic
Amber
A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
Stars: ✭ 2,345 (-85.03%)
Mutual labels:  framework, web-framework
Chicagoboss
Erlang web MVC, now featuring Comet
Stars: ✭ 1,825 (-88.35%)
Mutual labels:  framework, web-framework
Grial
A Node.js framework for creating GraphQL API servers easily and without a lot of boilerplate.
Stars: ✭ 194 (-98.76%)
Mutual labels:  api-server, framework
Asphalt
Asphalt application framework (core)
Stars: ✭ 198 (-98.74%)
Mutual labels:  asyncio, framework
Flamingo
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.
Stars: ✭ 198 (-98.74%)
Mutual labels:  framework, web-framework
Fastapi Crudrouter
A dynamic FastAPI router that automatically creates CRUD routes for your models
Stars: ✭ 159 (-98.98%)
Mutual labels:  asyncio, framework
Playframework
Play Framework
Stars: ✭ 12,041 (-23.11%)
Mutual labels:  framework, web-framework
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-98.86%)
Mutual labels:  api-server, web-framework
Flamingo Commerce
Flexible E-Commerce Framework on top of Flamingo. Used to build E-Commerce "Portals" and connect it with the help of individual Adapters to other services.
Stars: ✭ 151 (-99.04%)
Mutual labels:  framework, web-framework
Rocket
A web framework for Rust.
Stars: ✭ 15,760 (+0.64%)
Mutual labels:  framework, web-framework
Python Socketio
Python Socket.IO server and client
Stars: ✭ 2,655 (-83.05%)
Mutual labels:  asyncio, web-server
Trails
🌲 Modern Web Application Framework for Node.js.
Stars: ✭ 1,688 (-89.22%)
Mutual labels:  framework, web-framework
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (-99.07%)
Mutual labels:  framework, web-framework
Actionhero
Actionhero is a realtime multi-transport nodejs API Server with integrated cluster capabilities and delayed tasks
Stars: ✭ 2,280 (-85.44%)
Mutual labels:  api-server, framework

Sanic | Build fast. Run fast.

Sanic | Build fast. Run fast.

Build
Py310Test Py39Test Py38Test Py37Test
Docs
UserGuide Documentation
Package
Support
Stats

Sanic is a Python 3.7+ web server and web framework that's written to go fast. It allows the usage of the async/await syntax added in Python 3.5, which makes your code non-blocking and speedy.

Sanic is also ASGI compliant, so you can deploy it with an alternative ASGI webserver.

Source code on GitHub | Help and discussion board | User Guide | Chat on Discord

The project is maintained by the community, for the community. Contributions are welcome!

The goal of the project is to provide a simple way to get up and running a highly performant HTTP server that is easy to build, to expand, and ultimately to scale.

Sponsor

Check out open collective to learn more about helping to fund Sanic.

Thanks to Linode for their contribution towards the development and community of Sanic.

Linode

Installation

pip3 install sanic

Sanic makes use of uvloop and ujson to help with performance. If you do not want to use those packages, simply add an environmental variable SANIC_NO_UVLOOP=true or SANIC_NO_UJSON=true at install time.

$ export SANIC_NO_UVLOOP=true
$ export SANIC_NO_UJSON=true
$ pip3 install --no-binary :all: sanic

Note

If you are running on a clean install of Fedora 28 or above, please make sure you have the redhat-rpm-config package installed in case if you want to use sanic with ujson dependency.

Note

Windows support is currently "experimental" and on a best-effort basis. Multiple workers are also not currently supported on Windows (see Issue #1517), but setting workers=1 should launch the server successfully.

Hello World Example

from sanic import Sanic
from sanic.response import json

app = Sanic("My Hello, world app")

@app.route('/')
async def test(request):
    return json({'hello': 'world'})

if __name__ == '__main__':
    app.run()

Sanic can now be easily run using sanic hello.app.

[2018-12-30 11:37:41 +0200] [13564] [INFO] Goin' Fast @ http://127.0.0.1:8000
[2018-12-30 11:37:41 +0200] [13564] [INFO] Starting worker [13564]

And, we can verify it is working: curl localhost:8000 -i

HTTP/1.1 200 OK
Connection: keep-alive
Keep-Alive: 5
Content-Length: 17
Content-Type: application/json

{"hello":"world"}

Now, let's go build something fast!

Minimum Python version is 3.7. If you need Python 3.6 support, please use v20.12LTS.

Documentation

User Guide and API Documentation.

Changelog

Release Changelogs.

Questions and Discussion

Ask a question or join the conversation.

Contribution

We are always happy to have new contributions. We have marked issues good for anyone looking to get started, and welcome questions on the forums. Please take a look at our Contribution guidelines.

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].