基于百度amis前端框架的python pydantic模型封装。
Project description
amis-python
基于 百度amis 前端框架的python pydantic模型封装。
由于原版本缺少大量amis新版本的组件或配置,因此本项目在其版本的基础上进行了扩充。
相比fastapi-amis-admin的版本:
- 涵盖amis截至3.1.0版本的所有组件
- 使用jinja2模板
- 支持修改主题
安装
pip install amis-python
简单使用
from amis.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_py_model-1.0.0.tar.gz
(56.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amis_py_model-1.0.0.tar.gz.
File metadata
- Download URL: amis_py_model-1.0.0.tar.gz
- Upload date:
- Size: 56.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc38353419a2b8f6361d0b8c0d06ebd4d0207f2f85377c829fec5ce985f8cab8
|
|
| MD5 |
d148e1e12a0b75c87411667b5390444c
|
|
| BLAKE2b-256 |
3ac5dd1b81ac77074a33babe443e0ea8944bdb3e562361c822afd592ae4b44a2
|
File details
Details for the file amis_py_model-1.0.0-py3-none-any.whl.
File metadata
- Download URL: amis_py_model-1.0.0-py3-none-any.whl
- Upload date:
- Size: 58.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d0430930d50ef6332c42ee81a9035d44456755f3a84358f6c559f226bf38ce7
|
|
| MD5 |
15fe76951233a18fcb359dae537dfd11
|
|
| BLAKE2b-256 |
094e7290d6f1a1c45747fe663b34264c37c9cc7d3622bec091f71450006b03b4
|