Skip to main content

A simple asgi web framework

Project description

Fly Framework

Fly 是一个高性能、模块化、易于扩展的 Python Web 框架,旨在提供一个简单而全面的方式来构建 Web 应用程序。它支持同步和异步编程模式,最小化第三方依赖,确保轻量级和高效。

主要特性

  • 模块接口面向对象:服务基于协议,服务提供者注册到核心容器。
  • 路由系统:支持正常、路径参数和正则表达式路由。
  • 中间件:支持类、函数和生成器中间件。
  • 信号:支持内置信号和自定义信号。
  • Schema验证:支持路径、查询、Cookie、头部和正文参数验证。
  • 任务管理:支持后台、延迟和定时任务。
  • 测试:内置测试客户端支持 HTTP、WebSocket 和 SSE。
  • 配置管理:支持字典和 YAML 文件路径输入。
  • OpenAPI支持:自动生成文档和 SDK。
  • 调试工具:提供开发模式、调试壳和状态导出命令。
  • 命令行工具:内置 fly 命令行工具简化开发和部署流程。
  • 视图:支持函数和类基视图。
  • 上下文管理:类似 Flask 的请求和应用上下文。
  • 性能分析:请求性能分析和慢请求日志。

安装

使用 pip 安装 Fly:

pip install fly-web

快速开始

创建一个简单的应用:

from fly import Fly

app = Fly(__name__)

@app.get("/")
def hello():
    return "Hello, World!"

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

运行应用:

python app.py

打开浏览器访问 http://127.0.0.1:5000/,你将看到 "Hello, World!"。 打开浏览器访问 http://127.0.0.1:5000/swagger,可以查看生成的接口文档。

贡献

欢迎贡献!请阅读我们的贡献指南来了解如何参与改进 Fly。

许可证

Fly 采用 MIT 许可证。详情请参阅 LICENSE 文件。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fly_web-0.1.1.tar.gz (514.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fly_web-0.1.1-py3-none-any.whl (523.0 kB view details)

Uploaded Python 3

File details

Details for the file fly_web-0.1.1.tar.gz.

File metadata

  • Download URL: fly_web-0.1.1.tar.gz
  • Upload date:
  • Size: 514.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.0 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for fly_web-0.1.1.tar.gz
Algorithm Hash digest
SHA256 000b4267b11dbbae17ae5f8d50cac5967b9bc0f2ffa519d372cb7ecdcbc99bfc
MD5 f1b3f3c89030fc56f949eab3b35fe1ee
BLAKE2b-256 a8073f2ca71717b52981153c2cef598c4a7b98048a4babf1c379b4600f9ea1d1

See more details on using hashes here.

File details

Details for the file fly_web-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fly_web-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 523.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.0 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for fly_web-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 407a1ac7b24e53ec2974d7feea11990d3ff61c3c18d78ae48f5df3a7168f7eee
MD5 78d342666825007c8b92f4d12097313a
BLAKE2b-256 80c60352c81a540eee825e0400a521bab062301b5e944ee2d822d937d452f91a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page