more beautiful Typer
Project description
Rich Typer
介绍
本项目是将Rich和Typer结合在一起,将CLI打造的更加美观漂亮。
安装
pip install rich_typer
或者使用poetry
安装
git clone https://github.com/Elinpf/rich_typer
cd rich_typer
poetry build
pip install dist/<whl_file>
使用
除此之外增加了如下几个参数:
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.5.tar.gz
(9.1 kB
view details)
Built Distribution
File details
Details for the file rich_typer-0.1.5.tar.gz
.
File metadata
- Download URL: rich_typer-0.1.5.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.15.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30ad4501df122d8461afe23b86711a1b9535a44f5c135251a845583758725c53 |
|
MD5 | 599ec91f2b71c1f32aca00a280dba528 |
|
BLAKE2b-256 | e4dc9ac65a283732b120c6460a8e6dde912453e30ddb321ba3346423d1f2812d |
File details
Details for the file rich_typer-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: rich_typer-0.1.5-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.15.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d886a6e2acd504a025d93b24b22f43925754202c52f32fab0a0488e352077e8 |
|
MD5 | 8ad8c86bbd4c4e49c6c52f622ae5c5d7 |
|
BLAKE2b-256 | e6726f52a74ea9a19273c5ba5bf8ee9c4beec3ddccea42f653bd9f5de9ab2c9f |