more beautiful Typer
Project description
Rich Typer
介绍
本项目是将Rich和Typer结合在一起,将CLI打造的更加美观漂亮。
安装
pip install rich_typer
使用
除此之外增加了如下几个参数:
banner
增加标题banner_justify
标题位置epilog_blend
底部信息的渐变色usage
自定义Usage
Example
from rich_typer import RichTyper, Argument, Option
app = RichTyper()
banner = f"[b]Rich Typer[/b] [magenta][/] 🤑\n\n[dim]将 Rich 与 Typer 结合起来,使界面更加漂亮。\n"
url = "♥ https://github.com/Elinpf/rich_typer"
@app.command(banner=banner, banner_justify='center', epilog=url)
def main(
name: str = Argument(...,
help="Name of the [green]person to greet[/]."),
message: str = Option('ms', '-m', '--message',
help="The message [red]to[/] display"),
version: bool = Option(False, '-v', '--version',
help="Show the [u]version[/] and exit"),
) -> None:
"""[bold][blue]Rich Typer[/] example."""
...
app()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rich_typer-0.1.0.tar.gz
(9.0 kB
view hashes)
Built Distribution
rich_typer-0.1.0-py3-none-any.whl
(10.5 kB
view hashes)
Close
Hashes for rich_typer-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f614d528a19081134522fd9aa68b05614d057c5246ca75aaa9ef7807fc24b56 |
|
MD5 | 0d0c1e24971f4eeab65cf12340d08af1 |
|
BLAKE2b-256 | 6702f9837277e4e3d21b70c5d442bf1300a56f50f2f113818a8db7169c22a764 |