Typer (Slim)

0.24.0 · abandoned · verified Sat Mar 28

Typer-slim was initially conceived as a minimal version of the Typer library for building CLI applications, omitting dependencies like `rich` and `shellingham`. However, since version 0.22.0, `typer-slim` merely installs the full `typer` package, rendering its 'slim' purpose obsolete. As of version 0.24.1, `typer-slim` has been officially abandoned, with no further updates or releases planned. Users are strongly advised to install `typer` directly instead.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic Typer CLI application. To run, save as `main.py` and execute `python main.py hello --name Alice` or `python main.py hello`. While this works with `typer-slim`, directly installing and using `typer` is recommended.

import typer

app = typer.Typer()

@app.command()
def hello(name: str = 'World'):
    """Say hello to NAME."""
    typer.echo(f"Hello {name}!")

if __name__ == '__main__':
    app()

view raw JSON →