Amis介绍
amis 是Baidu团队开发的一个低代码前端框架,它使用 JSON 配置来生成页面,可以减少页面开发工作量,极大提升效率。python amis基于baidu amis , 对amis数据结构通过pydantic 转换为对应的python数据模型,并添加部分常用方法.
Amis亮点
- 不需要懂前端:在百度内部,大部分 amis 用户之前从来没写过前端页面,也不会
JavaScript,却能做出专业且复杂的后台界面,这是所有其他前端 UI 库都无法做到的; - 不受前端技术更新的影响:百度内部最老的 amis 页面是 6 年多前创建的,至今还在使用,而当年的
Angular/Vue/React版本现在都废弃了,当年流行的Gulp也被Webpack取代了,如果这些页面不是用 amis,现在的维护成本会很高; - 享受 amis 的不断升级:amis 一直在提升细节交互体验,比如表格首行冻结、下拉框大数据下不卡顿等,之前的 JSON 配置完全不需要修改;
- 可以 完全 使用 可视化页面编辑器 来制作页面:一般前端可视化编辑器只能用来做静态原型,而 amis 可视化编辑器做出的页面是可以直接上线的。
- 提供完整的界面解决方案:其它 UI 框架必须使用 JavaScript 来组装业务逻辑,而 amis 只需 JSON 配置就能完成完整功能开发,包括数据获取、表单提交及验证等功能,做出来的页面不需要经过二次开发就能直接上线;
- 大量内置组件(120+),一站式解决:其它 UI 框架大部分都只有最通用的组件,如果遇到一些稍微不常用的组件就得自己找第三方,而这些第三方组件往往在展现和交互上不一致,整合起来效果不好,而 amis 则内置大量组件,包括了富文本编辑器、代码编辑器、diff、条件组合、实时日志等业务组件,绝大部分中后台页面开发只需要了解 amis 就足够了;
- 支持扩展:除了低代码模式,还可以通过 自定义组件 来扩充组件,实际上 amis 可以当成普通 UI 库来使用,实现 90% 低代码,10% 代码开发的混合模式,既提升了效率,又不失灵活性;
- 容器支持无限级嵌套:可以通过嵌套来满足各种布局及展现需求;
- 经历了长时间的实战考验:amis 在百度内部得到了广泛使用,在 6 年多的时间里创建了 5 万页面,从内容审核到机器管理,从数据分析到模型训练,amis 满足了各种各样的页面需求,最复杂的页面有超过 1 万行 JSON 配置。
安装
pip install amis
简单示例
main.py:
from amis.components import Page
page = Page(title='标题', body='Hello World!')
# 输出为json
print(page.amis_json())
# 输出为dict
print(page.amis_dict())
# 输出页面html
print(page.amis_html())
开发文档
参考: Amis官方文档
依赖项目
许可协议
该项目遵循 Apache2.0 许可协议。
Metadata
Release files for amis 0.1.1
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 |
|---|---|---|---|---|
| amis-0.1.1.tar.gz | 36.3 kB | Without provenance | Details for amis-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| amis-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for amis-0.1.1-py3-none-any.whl |
Total release size: 73.4 kB
Release files / amis-0.1.1.tar.gz
| Download URL | amis-0.1.1.tar.gz |
|---|---|
| Size | 36.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02177814e2f937faa5af2b6e959f820b7c1cbcf8bc55b5d863aad5825e46d2f8
|
|
BLAKE2b-256 checksum How to use checksums |
3357394ad06c1e99421a4437b1e0a74d70cd9cc91a1b1efe7a54fab490a4a04f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.27.1
|
Release files / amis-0.1.1-py3-none-any.whl
| Download URL | amis-0.1.1-py3-none-any.whl |
|---|---|
| Size | 37.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c2c925be9ad6b43fcac70a7ef64289b17c9c59194427d97a34bab27b8c9b9a2
|
|
BLAKE2b-256 checksum How to use checksums |
11ce4ec9a5a291299b37ebf3d663d245df681c8cbcc2a520eb612915c52f0dd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.27.1
|
Security for amis 0.1.1
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.