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 {"message": "fly fly"}

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

运行应用:

python app.py

打开浏览器访问 http://127.0.0.1:5000/,你将看到 {"message": "fly fly"}

打开浏览器访问 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.2.tar.gz (514.6 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.2-py3-none-any.whl (523.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fly_web-0.1.2.tar.gz
  • Upload date:
  • Size: 514.6 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.2.tar.gz
Algorithm Hash digest
SHA256 af08102e88fda104d34baf088544460d91df35cef4fff936bb5768821af2d842
MD5 ab6e3284c50b809a9cbff69f01ed4c1b
BLAKE2b-256 fe465202373579363e50e99a440d1b78bff8b997250eef366579c30e6f8b9c09

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fly_web-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 523.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 352255e17a576866438bdd4b17651cdf2445446d2b5f6137b5a158fc9d79e51f
MD5 2c47086e025cd9de5024790a153fec76
BLAKE2b-256 c7e915efa457bb1912b18ec94c42cc4b9175d4eb13a21f8304bfd39fe39b7fe5

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