基于百度amis前端框架的python pydantic模型封装。
Project description
amis-py
基于百度amis前端框架的python pydantic模型封装。
由于原版本缺少大量amis新版本的组件,因此本项目在其版本的基础上进行了扩充。
相比fastapi-amis-admin的版本:
- 涵盖amis截至2.3.1版本的所有组件
- 使用jinja2模板
- 支持修改主题
安装
pip install amis-py
简单使用
from amis_py.components import Page
page = Page(title='新页面', body='Hello World')
# 输出为python字典
print(page.to_dict())
# 输出为json
print(page.to_json())
# 输出为str
print(page.render())
# 保存为html文件
with open('HelloWorld.html', 'w', encoding='utf-8') as f:
f.write(page.render())
详细使用
详见amis官方文档
感谢
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
amis-python-1.0.0.tar.gz
(44.5 kB
view hashes)
Built Distribution
Close
Hashes for amis_python-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b705c39ad4c7efd708ffd6e82135addcd775870f8dde6408baf86a10e556939 |
|
MD5 | 4c1638a8388ded072372fc2bd9436427 |
|
BLAKE2b-256 | 744aa77222284cd9b91d33249c7dd3be67d2d2aa0f2dd56afa0ddb822d2bf64d |