description
Project description
:rocket: AppZoo :facepunch:
Install
pip install -U appzoo
Usage
- Rest Api
import jieba
from appzoo import App
pred1 = lambda **kwargs: kwargs['x'] + kwargs['y']
pred2 = lambda x=1, y=1: x - y
pred3 = lambda text='小米是家不错的公司': jieba.lcut(text)
app = App(verbose=True)
app.add_route("/", pred1, result_key='result')
app.add_route("/f1", pred1, version="1")
app.add_route("/f2", pred2, version="2")
app.add_route("/f3", pred3, version="3")
app.run() # appcli easy-run ./apps
- 带缓存
@lru_cache()
def post_func(kwargs: str):
logger.info(kwargs)
return kwargs
app.add_route_plus(post_func)
- Fast Api
app-run - fastapi demo.py
app-run - fastapi -- --help
app-run - streamlit demo.py
app-run - streamlit -- --help
TODO
- add logger: 采样
- add scheduler
- add 监听服务
- add rpc服务
- hive等穿透
- add thrift https://github.com/Thriftpy/thriftpy2
- add dataReport
- add plotly
- add explain
- add 限制次数 https://slowapi.readthedocs.io/en/latest/
对于RESTful API的URL具体设计的规范如下: 1.不用大写字母,所有单词使用英文且小写。 2.连字符用中杠"-“而不用下杠”_" 3.正确使用 “/“表示层级关系,URL的层级不要过深,并且越靠前的层级应该相对越稳定 4.结尾不要包含正斜杠分隔符”/” 5.URL中不出现动词,用请求方式表示动作 6.资源表示用复数不要用单数 7.不要使用文件扩展名
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
appzoo-2022.10.17.17.33.4.tar.gz
(69.8 kB
view hashes)
Built Distribution
Close
Hashes for appzoo-2022.10.17.17.33.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5af356c5a235c59caef92e7b8cfa57048778fcd0fb297a3c4cda86d2888bc43 |
|
MD5 | 5f8ef74c8a7f0c6989e86d681afd5053 |
|
BLAKE2b-256 | 3a7ff6a80523807ce595d7db72759a8fc16f3b29a04dcf13b9c35d898546c13e |
Close
Hashes for appzoo-2022.10.17.17.33.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be06722e4c7c96b53512bf00664555dd2e6d3c7d4869b3ee9916f3e1a239b013 |
|
MD5 | e1799d2341130df4aeac9118d840d6f2 |
|
BLAKE2b-256 | 06546de9ebe1b3b298b64eacaaaeb290ded37b779a2a7f7446e0180d8bdc8e9f |