Skip to content

Commit 826559a

Browse files
committed
Added support for Typer and Rich
1 parent f6b9e2d commit 826559a

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/my_package/my_cli.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# my_cli.py (minimal version for testing)
2+
import typer
3+
4+
app = typer.Typer()
5+
6+
@app.command()
7+
def minimal(item: str): # Or whatever simple command you used for the minimal test
8+
"""A very simple command."""
9+
print(f"Item: {item}")
10+
11+
if __name__ == "__main__":
12+
app()

src/my_package/rich_demo.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# rich_demo.py
2+
from rich import print
3+
from rich.panel import Panel
4+
from rich.table import Table
5+
6+
my_dict = {"name": "AJ", "role": "Cloud AI Architect", "skills": ["Python", "AWS", "MLOps", "GenAI"]}
7+
my_list = [1, "apple", {"key": "value"}, True, None, 3.14]
8+
9+
print("--- Rich Printing ---")
10+
print(my_dict)
11+
print(my_list)
12+
13+
print(Panel("Hello, [bold magenta]World[/]!", title="[bold green]Welcome[/]", subtitle="Thank you"))
14+
15+
table = Table(title="My Project Tasks")
16+
table.add_column("ID", style="dim", width=12)
17+
table.add_column("Task Name")
18+
table.add_column("Status", justify="right")
19+
20+
table.add_row("1", "Setup Environment", "[green]Done[/green]")
21+
table.add_row("2", "Develop Model", "[yellow]In Progress[/yellow]")
22+
table.add_row("3", "Deploy to SageMaker", "[red]Pending[/red]")
23+
24+
print(table)

0 commit comments

Comments
 (0)