: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.不要使用文件扩展名
Metadata
Release files for AppZoo 2023.4.25.19.12.44
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| AppZoo-2023.4.25.19.12.44.tar.gz | 6.6 MB | Without provenance | Details for AppZoo-2023.4.25.19.12.44.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| AppZoo-2023.4.25.19.12.44-py3-none-any.whl | Python 3 | none | any | Details for AppZoo-2023.4.25.19.12.44-py3-none-any.whl |
Total release size: 13.4 MB
Release files / AppZoo-2023.4.25.19.12.44.tar.gz
| Download URL | AppZoo-2023.4.25.19.12.44.tar.gz |
|---|---|
| Size | 6.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fcd44fbbca803e83e5393bf96e0f63a9abf32088fd68f2ed1de4a0f0a02908b2
|
|
BLAKE2b-256 checksum How to use checksums |
262ece3a1c68f0612f826db5992c38863e3cbaba1ed7fd1dad8908e0124a8cdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.13
|
Release files / AppZoo-2023.4.25.19.12.44-py3-none-any.whl
| Download URL | AppZoo-2023.4.25.19.12.44-py3-none-any.whl |
|---|---|
| Size | 6.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dfffe5d1fb5bd4f71108040fdfb5409d2f11ab8a730f3b303907746b51814f89
|
|
BLAKE2b-256 checksum How to use checksums |
b11d2645c1d4d2a16cdbfb31cdc04f974cb5656ddbdcdfa6a59eba232d3a0934
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.13
|
Security for AppZoo 2023.4.25.19.12.44
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.