Cxalio Rich UI component library — declarative CLI interface components for terminal applications.
Project description
cx-wealth
基于 Rich 的终端 UI 组件库,为 CLI 应用提供声明式帮助系统、标签渲染、详情面板和自适应布局等扩展。
安装
pip install cx-wealth
要求 Python >= 3.12, < 3.15。
组件
WealthHelp — 声明式帮助系统 DSL
替代 argparse 的原生帮助输出。通过 add_group / add_action / add_note 构建结构化帮助信息,支持 Rich 样式的主题化输出。
from cx_wealth import WealthHelp
help = WealthHelp(prog="myapp", description="My CLI tool")
help.add_action("--input", help="Input file path", nargs=1)
help.add_action("--output", help="Output file path", nargs=1)
help.add_group("Advanced", description="Advanced options")
help.add_note("See docs for more details.")
WealthLabel — 可组合标签渲染
将实现了 __rich_label__() 协议的对象渲染为带 Markup 和样式的紧凑文本行。支持 crop、ellipsis、fold 三种溢出处理方式,可自定义分隔符。
from cx_wealth import WealthLabelMixin
class MyItem(WealthLabelMixin):
def __rich_label__(self):
yield "[bold]MyItem[/]"
yield "status: active"
yield "[green]●[/]"
WealthDetail / WealthDetailPanel — 详情展示
将实现了 __rich_detail__() 协议的对象渲染为两列键值表格。支持子面板嵌套和 Rich 样式。
IndexedListPanel — 索引列表
在 Rich Panel 中显示带行号索引的列表。支持起始索引、最大行数控制(超出显示省略号)、边框样式自定义。
from cx_wealth import IndexedListPanel
panel = IndexedListPanel(items=["a", "b", "c"], title="Files")
DynamicColumns — 自适应多列布局
根据终端宽度自动计算列数和列宽,将对象集合渲染为多列布局。
链接
返回项目首页:cx-studio-tk
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
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 cx_wealth-0.7.5.tar.gz.
File metadata
- Download URL: cx_wealth-0.7.5.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3843421a8e2ff1c740a950f69175bfc5b004f92bf1befcdbea164e9b0ee28dbb
|
|
| MD5 |
2a64abf2bb9f06c16cee63f33afe662b
|
|
| BLAKE2b-256 |
053d009ac5eebb0c7090053562f8cf227581f398c4de842d31cca1e4a8fb973d
|
File details
Details for the file cx_wealth-0.7.5-py3-none-any.whl.
File metadata
- Download URL: cx_wealth-0.7.5-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61c3875cae0d06be2fe43297db16ca29c229eb14a81662173a8fbe885134cdda
|
|
| MD5 |
377766c4c1d73def00122020b36645fe
|
|
| BLAKE2b-256 |
178c9db396214f24419d315e762ae716af0b97775e1f38070434af304b27e057
|