一个现代、快速、简单的异步python3 web框架

网友投稿 550 2022-10-28

一个现代、快速、简单的异步python3 web框架

一个现代、快速、简单的异步python3 web框架

Albatross

A modern, fast, simple, natively-async web framework. (Python3.5 only)

from albatross import Serverimport asyncioclass Handler: async def on_get(self, req, res): await asyncio.sleep(0.1) res.write('Hello, %s' % req.args['name'])app = Server()app.add_route('/{name})', Handler())app.serve()

Notes for Usage

For now (pre 1.0.0), I'm making no claims about API stability (but will try to avoid changes). That said, I'm using this framework for some small projects, and it is a joy to work in! Reach out if you want to use this, as I'm happy to incorporate your feedback!

Install

pip3 install albatross3

Features

You can read the entire codebase in about 30 minutes. It's natively async. Doing await database calls or controller calls in your views just works! This works with the uvloop project, to make your server fast!

Benchmarks

My benchmarks indicate that albatross is as fast as aiohttp, both of which are twice as fast as tornado. You can run the benchmarks by poking around in the bench/ folder.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:MUI 最接近原生APP体验的高性能框架
下一篇:Pychievements:一个用来创建和追踪Achievments 的 Python 框架
相关文章

 发表评论

暂时没有评论,来抢沙发吧~