跳转到主要内容

一系列有偏见的Flask蓝图

项目描述

免责声明 该存储库是Runnerly的一部分,Runnerly是一个用于Python微服务开发的工具。它仅用于教育目的,不适合生产环境。它仍在更新中。如果您发现任何问题或想与作者交流,请随时在问题跟踪器中打开问题。

构建JSON网络服务的Flask辅助工具。

安装

$ pip install flakon

目前功能

  • a JsonBlueprint: 像蓝图但一切都是json化

  • a SwaggerBlueprint: 像JsonBlueprint但可以传递swagger规范并使用@operation(‘operationId’), 而不是@route

  • 使用Konfig加载INI文件以更新app.config

用法示例

from flakon import SwaggerBlueprint, JsonBluePrint, create_app


api = SwaggerBlueprint('Swagger API', 'swagger' ,
                       swagger_spec='openapi.yaml')

@api.operation('getUserIds')
def get_user_ids():
    return {'one': 2}

other_api = JsonBlueprint('api', __name__)

@other_api.route('/')
def some():
    return {'here': 1}


app = create_app(blueprints=[api, other_api])

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

flakon-0.2.tar.gz (7.7 kB 查看哈希值)

上传时间

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面