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)
其中参数说明:
-
packages: 指定
blueprint
的包路径,启动时会自动扫描并注册 -
profile: 指定配置文件所有目录
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
libras-1.0.3.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file libras-1.0.3.tar.gz
.
File metadata
- Download URL: libras-1.0.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 605ae772ae032fd6abac916c9262f22f96c937168f3a52881a1b81d4ab305f7b |
|
MD5 | f91fbc1a290d21830a6e2566326d5a7d |
|
BLAKE2b-256 | 12e94493e15e5ab12d8fa47f152453f340120ceee7dd3b0883d441f35371c609 |
File details
Details for the file libras-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: libras-1.0.3-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9293dd22adfa93117bfa846b13f5c00bbf048edd0359d1eee8babafe56da4a7c |
|
MD5 | 854403b53c42c2bb4d7643189a0895de |
|
BLAKE2b-256 | 22c1a89fa8630000cc37b5bbdac5c48869261cb8c06b314d4b5e14b8c64c9c65 |