Skip to main content

Based on the flask web framework

Project description

   Libras

基于Flask框架的Web服务框架

简单封装了Flask框架,并提供了如下功能:

  • 提供了yaml | yml格式文件配置,且配置文件可与工程分离,达到不同环境的配置更加灵活,

  • 重写了Flask类,定义了统一异常处理、配置类、请求日志输出等。

  • 实现对blueprint的包路径扫描机制,开发只需在对应包中,按规定格式实现 api接口,框架会自动注册到flask blueprint中。

  • 使用外观模式,简化程序启动入口,只需一行代码即可启动。

使用方式

# 入口

from Libras import Application

if __name__ == '__main__':
    Application(packages='app.api', profile='/').run(host='0.0.0.0', port=9003)

其中参数说明:

  1. packages: 指定blueprint的包路径,启动时会自动扫描并注册

  2. profile: 指定配置文件所有目录

Project details


Download files

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

Files for libras, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size libras-1.0.3-py3-none-any.whl (7.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size libras-1.0.3.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page