flama
v1.9.5
Flama是一個Python庫,它為API的開發和部署建立了標準的框架,並特別關注機器學習(ML)。該框架的主要目的是使ML API的部署變得非常簡單,將整個過程簡化為一行代碼。
該圖書館建立在《星條》上,並提供了一種易於學習的理念,可以加快構建高性能的GraphQL,REST和ML API。此外,它為開發異步和生產就緒服務的開發提供了理想的解決方案,並為ML模型提供了自動部署。
一些顯著特徵:
Component s。諸如Request , Response , Session之類的Flama Asgi對象定義為準備在您的端點中註入的Component 。Component s作為插件生態系統的基礎,允許您創建自定義或使用端點中定義的插件,並註入了參數。docs ,並提供Swagger UI和REDOC端點。limit-offset和page numbering等。 Flama與所有受支持的Python完全兼容。我們建議您使用可用的最新版本。
有關如何安裝Flama訪問的詳細說明:https://flama.dev/docs/getting-started/installation。
請訪問https://flama.dev/docs/getting-started/quickstart,開始使用Flama。
請訪問https://flama.dev/docs/查看完整文檔。
from flama import Flama
app = Flama (
title = "Hello-" ,
version = "1.0" ,
description = "My first API" ,
)
@ app . route ( "/" )
def home ():
"""
tags:
- Salute
summary:
Returns a warming message
description:
This is a more detailed description of the method itself.
Here we can give all the details required and they will appear
automatically in the auto-generated docs.
responses:
200:
description: Warming hello message!
"""
return { "message" : "Hello " }此示例將構建並運行Hello API。運行它:
flama run examples.hello_flama:app
該項目絕對可以接受貢獻,因此,如果您有一個好主意,請在提交拉動請求之前閱讀我們的貢獻文檔。