typer-slim 0.12.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- typer_slim-0.12.dev1/LICENSE +21 -0
- typer_slim-0.12.dev1/PKG-INFO +422 -0
- typer_slim-0.12.dev1/README.md +384 -0
- typer_slim-0.12.dev1/docs_src/app_dir/tutorial001.py +16 -0
- typer_slim-0.12.dev1/docs_src/arguments/default/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/arguments/default/tutorial001_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/arguments/default/tutorial002.py +15 -0
- typer_slim-0.12.dev1/docs_src/arguments/default/tutorial002_an.py +16 -0
- typer_slim-0.12.dev1/docs_src/arguments/envvar/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/arguments/envvar/tutorial001_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/arguments/envvar/tutorial002.py +9 -0
- typer_slim-0.12.dev1/docs_src/arguments/envvar/tutorial002_an.py +12 -0
- typer_slim-0.12.dev1/docs_src/arguments/envvar/tutorial003.py +9 -0
- typer_slim-0.12.dev1/docs_src/arguments/envvar/tutorial003_an.py +14 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial001_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial002.py +12 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial002_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial003.py +12 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial003_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial004.py +12 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial004_an.py +17 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial005.py +13 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial005_an.py +17 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial006.py +9 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial006_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial007.py +20 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial007_an.py +22 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial008.py +12 -0
- typer_slim-0.12.dev1/docs_src/arguments/help/tutorial008_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/arguments/optional/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/arguments/optional/tutorial001_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/arguments/optional/tutorial002.py +14 -0
- typer_slim-0.12.dev1/docs_src/arguments/optional/tutorial002_an.py +15 -0
- typer_slim-0.12.dev1/docs_src/arguments/optional/tutorial003.py +9 -0
- typer_slim-0.12.dev1/docs_src/commands/arguments/tutorial001.py +17 -0
- typer_slim-0.12.dev1/docs_src/commands/callback/tutorial001.py +36 -0
- typer_slim-0.12.dev1/docs_src/commands/callback/tutorial002.py +17 -0
- typer_slim-0.12.dev1/docs_src/commands/callback/tutorial003.py +22 -0
- typer_slim-0.12.dev1/docs_src/commands/callback/tutorial004.py +23 -0
- typer_slim-0.12.dev1/docs_src/commands/context/tutorial001.py +25 -0
- typer_slim-0.12.dev1/docs_src/commands/context/tutorial002.py +25 -0
- typer_slim-0.12.dev1/docs_src/commands/context/tutorial003.py +26 -0
- typer_slim-0.12.dev1/docs_src/commands/context/tutorial004.py +15 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial001.py +62 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial001_an.py +67 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial002.py +23 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial003.py +25 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial004.py +34 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial004_an.py +37 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial005.py +34 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial005_an.py +37 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial006.py +55 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial007.py +39 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial007_an.py +46 -0
- typer_slim-0.12.dev1/docs_src/commands/help/tutorial008.py +15 -0
- typer_slim-0.12.dev1/docs_src/commands/index/tutorial001.py +12 -0
- typer_slim-0.12.dev1/docs_src/commands/index/tutorial002.py +17 -0
- typer_slim-0.12.dev1/docs_src/commands/index/tutorial003.py +17 -0
- typer_slim-0.12.dev1/docs_src/commands/name/tutorial001.py +17 -0
- typer_slim-0.12.dev1/docs_src/commands/one_or_multiple/tutorial001.py +17 -0
- typer_slim-0.12.dev1/docs_src/commands/one_or_multiple/tutorial002.py +21 -0
- typer_slim-0.12.dev1/docs_src/commands/options/tutorial001.py +40 -0
- typer_slim-0.12.dev1/docs_src/commands/options/tutorial001_an.py +43 -0
- typer_slim-0.12.dev1/docs_src/exceptions/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/exceptions/tutorial002.py +12 -0
- typer_slim-0.12.dev1/docs_src/exceptions/tutorial003.py +12 -0
- typer_slim-0.12.dev1/docs_src/exceptions/tutorial004.py +12 -0
- typer_slim-0.12.dev1/docs_src/first_steps/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/first_steps/tutorial002.py +9 -0
- typer_slim-0.12.dev1/docs_src/first_steps/tutorial003.py +9 -0
- typer_slim-0.12.dev1/docs_src/first_steps/tutorial004.py +12 -0
- typer_slim-0.12.dev1/docs_src/first_steps/tutorial005.py +12 -0
- typer_slim-0.12.dev1/docs_src/first_steps/tutorial006.py +17 -0
- typer_slim-0.12.dev1/docs_src/launch/tutorial001.py +10 -0
- typer_slim-0.12.dev1/docs_src/launch/tutorial002.py +21 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/arguments_with_multiple_values/tutorial001.py +15 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/arguments_with_multiple_values/tutorial002.py +16 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/arguments_with_multiple_values/tutorial002_an.py +17 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/multiple_options/tutorial001.py +15 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/multiple_options/tutorial001_an.py +16 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/multiple_options/tutorial002.py +11 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/multiple_options/tutorial002_an.py +12 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/options_with_multiple_values/tutorial001.py +17 -0
- typer_slim-0.12.dev1/docs_src/multiple_values/options_with_multiple_values/tutorial001_an.py +18 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial001.py +17 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial001_an.py +18 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial002.py +18 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial002_an.py +19 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial003.py +20 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial003_an.py +21 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial004.py +20 -0
- typer_slim-0.12.dev1/docs_src/options/callback/tutorial004_an.py +21 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial001.py +21 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial001_an.py +22 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial002.py +26 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial002_an.py +33 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial003.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial003_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial004.py +13 -0
- typer_slim-0.12.dev1/docs_src/options/help/tutorial004_an.py +14 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial001_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial002.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial002_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial003.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial003_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial004.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial004_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial005.py +15 -0
- typer_slim-0.12.dev1/docs_src/options/name/tutorial005_an.py +16 -0
- typer_slim-0.12.dev1/docs_src/options/password/tutorial001.py +11 -0
- typer_slim-0.12.dev1/docs_src/options/password/tutorial001_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/options/password/tutorial002.py +15 -0
- typer_slim-0.12.dev1/docs_src/options/password/tutorial002_an.py +16 -0
- typer_slim-0.12.dev1/docs_src/options/prompt/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/prompt/tutorial001_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/options/prompt/tutorial002.py +11 -0
- typer_slim-0.12.dev1/docs_src/options/prompt/tutorial002_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/options/prompt/tutorial003.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/prompt/tutorial003_an.py +12 -0
- typer_slim-0.12.dev1/docs_src/options/required/tutorial001.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/required/tutorial001_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/options/required/tutorial002.py +9 -0
- typer_slim-0.12.dev1/docs_src/options/version/tutorial001.py +24 -0
- typer_slim-0.12.dev1/docs_src/options/version/tutorial001_an.py +25 -0
- typer_slim-0.12.dev1/docs_src/options/version/tutorial002.py +29 -0
- typer_slim-0.12.dev1/docs_src/options/version/tutorial002_an.py +30 -0
- typer_slim-0.12.dev1/docs_src/options/version/tutorial003.py +30 -0
- typer_slim-0.12.dev1/docs_src/options/version/tutorial003_an.py +32 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial001.py +12 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial001_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial002.py +21 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial002_an.py +22 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial003.py +27 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial003_an.py +28 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial004.py +32 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial004_an.py +33 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial005.py +29 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial005_an.py +30 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial006.py +15 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial006_an.py +18 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial007.py +33 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial007_an.py +35 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial008.py +36 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial008_an.py +38 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial009.py +37 -0
- typer_slim-0.12.dev1/docs_src/options_autocompletion/tutorial009_an.py +39 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial001.py +12 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial001_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial002.py +16 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial002_an.py +17 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial003.py +12 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial003_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial004.py +12 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/bool/tutorial004_an.py +13 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/custom_types/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/custom_types/tutorial001.py +25 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/custom_types/tutorial001_an.py +26 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/custom_types/tutorial002.py +29 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/custom_types/tutorial002_an.py +32 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/datetime/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/datetime/tutorial001.py +12 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/datetime/tutorial002.py +15 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/datetime/tutorial002_an.py +19 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/enum/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/enum/tutorial001.py +17 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/enum/tutorial002.py +19 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/enum/tutorial002_an.py +22 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/enum/tutorial003.py +18 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/enum/tutorial003_an.py +19 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial001.py +10 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial001_an.py +11 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial002.py +10 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial002_an.py +11 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial003.py +13 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial003_an.py +14 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial004.py +17 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial004_an.py +18 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial005.py +10 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/file/tutorial005_an.py +11 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/index/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/index/tutorial001.py +12 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/number/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/number/tutorial001.py +15 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/number/tutorial001_an.py +16 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/number/tutorial002.py +15 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/number/tutorial002_an.py +16 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/number/tutorial003.py +9 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/number/tutorial003_an.py +10 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/path/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/path/tutorial001.py +21 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/path/tutorial001_an.py +22 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/path/tutorial002.py +22 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/path/tutorial002_an.py +25 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/uuid/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/parameter_types/uuid/tutorial001.py +12 -0
- typer_slim-0.12.dev1/docs_src/printing/tutorial001.py +19 -0
- typer_slim-0.12.dev1/docs_src/printing/tutorial002.py +10 -0
- typer_slim-0.12.dev1/docs_src/printing/tutorial003.py +16 -0
- typer_slim-0.12.dev1/docs_src/printing/tutorial004.py +12 -0
- typer_slim-0.12.dev1/docs_src/printing/tutorial005.py +15 -0
- typer_slim-0.12.dev1/docs_src/printing/tutorial006.py +9 -0
- typer_slim-0.12.dev1/docs_src/progressbar/tutorial001.py +17 -0
- typer_slim-0.12.dev1/docs_src/progressbar/tutorial002.py +20 -0
- typer_slim-0.12.dev1/docs_src/progressbar/tutorial003.py +17 -0
- typer_slim-0.12.dev1/docs_src/progressbar/tutorial004.py +23 -0
- typer_slim-0.12.dev1/docs_src/progressbar/tutorial005.py +17 -0
- typer_slim-0.12.dev1/docs_src/progressbar/tutorial006.py +17 -0
- typer_slim-0.12.dev1/docs_src/prompt/tutorial001.py +10 -0
- typer_slim-0.12.dev1/docs_src/prompt/tutorial002.py +13 -0
- typer_slim-0.12.dev1/docs_src/prompt/tutorial003.py +10 -0
- typer_slim-0.12.dev1/docs_src/prompt/tutorial004.py +11 -0
- typer_slim-0.12.dev1/docs_src/subcommands/callback_override/tutorial001.py +20 -0
- typer_slim-0.12.dev1/docs_src/subcommands/callback_override/tutorial002.py +20 -0
- typer_slim-0.12.dev1/docs_src/subcommands/callback_override/tutorial003.py +25 -0
- typer_slim-0.12.dev1/docs_src/subcommands/callback_override/tutorial004.py +31 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial001.py +15 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial002.py +22 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial003.py +22 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial004.py +29 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial005.py +37 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial006.py +37 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial007.py +37 -0
- typer_slim-0.12.dev1/docs_src/subcommands/name_help/tutorial008.py +42 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial001/items.py +22 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial001/main.py +11 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial001/users.py +17 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial002/main.py +36 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial003/items.py +22 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial003/lands.py +11 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial003/main.py +13 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial003/reigns.py +17 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial003/towns.py +17 -0
- typer_slim-0.12.dev1/docs_src/subcommands/tutorial003/users.py +17 -0
- typer_slim-0.12.dev1/docs_src/terminating/tutorial001.py +25 -0
- typer_slim-0.12.dev1/docs_src/terminating/tutorial002.py +12 -0
- typer_slim-0.12.dev1/docs_src/terminating/tutorial003.py +12 -0
- typer_slim-0.12.dev1/docs_src/testing/app01/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/testing/app01/main.py +16 -0
- typer_slim-0.12.dev1/docs_src/testing/app01/test_main.py +12 -0
- typer_slim-0.12.dev1/docs_src/testing/app02/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/testing/app02/main.py +12 -0
- typer_slim-0.12.dev1/docs_src/testing/app02/test_main.py +11 -0
- typer_slim-0.12.dev1/docs_src/testing/app02_an/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/testing/app02_an/main.py +13 -0
- typer_slim-0.12.dev1/docs_src/testing/app02_an/test_main.py +11 -0
- typer_slim-0.12.dev1/docs_src/testing/app03/__init__.py +0 -0
- typer_slim-0.12.dev1/docs_src/testing/app03/main.py +9 -0
- typer_slim-0.12.dev1/docs_src/testing/app03/test_main.py +15 -0
- typer_slim-0.12.dev1/docs_src/using_click/tutorial001.py +14 -0
- typer_slim-0.12.dev1/docs_src/using_click/tutorial002.py +24 -0
- typer_slim-0.12.dev1/docs_src/using_click/tutorial003.py +34 -0
- typer_slim-0.12.dev1/docs_src/using_click/tutorial004.py +36 -0
- typer_slim-0.12.dev1/pyproject.toml +208 -0
- typer_slim-0.12.dev1/requirements-docs.txt +17 -0
- typer_slim-0.12.dev1/requirements-tests.txt +9 -0
- typer_slim-0.12.dev1/requirements.txt +6 -0
- typer_slim-0.12.dev1/scripts/build-docs.sh +5 -0
- typer_slim-0.12.dev1/scripts/clean.sh +8 -0
- typer_slim-0.12.dev1/scripts/docs-live.sh +5 -0
- typer_slim-0.12.dev1/scripts/format-imports.sh +6 -0
- typer_slim-0.12.dev1/scripts/format.sh +6 -0
- typer_slim-0.12.dev1/scripts/get-pwsh-activate.sh +1 -0
- typer_slim-0.12.dev1/scripts/lint.sh +8 -0
- typer_slim-0.12.dev1/scripts/publish.sh +5 -0
- typer_slim-0.12.dev1/scripts/test-cov-html.sh +6 -0
- typer_slim-0.12.dev1/scripts/test-files.sh +10 -0
- typer_slim-0.12.dev1/scripts/test.sh +11 -0
- typer_slim-0.12.dev1/scripts/zip-docs.sh +11 -0
- typer_slim-0.12.dev1/tests/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/assets/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/assets/cli/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/assets/cli/app_other_name.py +8 -0
- typer_slim-0.12.dev1/tests/assets/cli/empty_script.py +0 -0
- typer_slim-0.12.dev1/tests/assets/cli/func_other_name.py +2 -0
- typer_slim-0.12.dev1/tests/assets/cli/multi_app.py +40 -0
- typer_slim-0.12.dev1/tests/assets/cli/multi_app_cli.py +22 -0
- typer_slim-0.12.dev1/tests/assets/cli/multi_func.py +12 -0
- typer_slim-0.12.dev1/tests/assets/cli/multiapp-docs.md +102 -0
- typer_slim-0.12.dev1/tests/assets/cli/not_python.txt +1 -0
- typer_slim-0.12.dev1/tests/assets/cli/sample.py +25 -0
- typer_slim-0.12.dev1/tests/assets/compat_click7_8.py +29 -0
- typer_slim-0.12.dev1/tests/assets/completion_no_types.py +23 -0
- typer_slim-0.12.dev1/tests/assets/completion_no_types_order.py +23 -0
- typer_slim-0.12.dev1/tests/assets/prog_name.py +12 -0
- typer_slim-0.12.dev1/tests/assets/type_error_no_rich.py +12 -0
- typer_slim-0.12.dev1/tests/assets/type_error_no_rich_short_disable.py +16 -0
- typer_slim-0.12.dev1/tests/assets/type_error_normal_traceback.py +22 -0
- typer_slim-0.12.dev1/tests/test_ambiguous_params.py +236 -0
- typer_slim-0.12.dev1/tests/test_annotated.py +78 -0
- typer_slim-0.12.dev1/tests/test_cli/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_cli/test_app_other_name.py +41 -0
- typer_slim-0.12.dev1/tests/test_cli/test_completion_run.py +20 -0
- typer_slim-0.12.dev1/tests/test_cli/test_doc.py +112 -0
- typer_slim-0.12.dev1/tests/test_cli/test_empty_script.py +20 -0
- typer_slim-0.12.dev1/tests/test_cli/test_func_other_name.py +22 -0
- typer_slim-0.12.dev1/tests/test_cli/test_help.py +38 -0
- typer_slim-0.12.dev1/tests/test_cli/test_multi_app.py +123 -0
- typer_slim-0.12.dev1/tests/test_cli/test_multi_app_cli.py +102 -0
- typer_slim-0.12.dev1/tests/test_cli/test_multi_app_sub.py +46 -0
- typer_slim-0.12.dev1/tests/test_cli/test_multi_func.py +106 -0
- typer_slim-0.12.dev1/tests/test_cli/test_not_python.py +20 -0
- typer_slim-0.12.dev1/tests/test_cli/test_sub.py +139 -0
- typer_slim-0.12.dev1/tests/test_cli/test_sub_completion.py +20 -0
- typer_slim-0.12.dev1/tests/test_cli/test_sub_help.py +24 -0
- typer_slim-0.12.dev1/tests/test_cli/test_version.py +11 -0
- typer_slim-0.12.dev1/tests/test_compat/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_compat/test_option_get_help.py +54 -0
- typer_slim-0.12.dev1/tests/test_completion/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_completion/test_completion.py +165 -0
- typer_slim-0.12.dev1/tests/test_completion/test_completion_complete.py +170 -0
- typer_slim-0.12.dev1/tests/test_completion/test_completion_complete_no_help.py +67 -0
- typer_slim-0.12.dev1/tests/test_completion/test_completion_install.py +174 -0
- typer_slim-0.12.dev1/tests/test_completion/test_completion_show.py +155 -0
- typer_slim-0.12.dev1/tests/test_exit_errors.py +45 -0
- typer_slim-0.12.dev1/tests/test_others.py +260 -0
- typer_slim-0.12.dev1/tests/test_prog_name.py +13 -0
- typer_slim-0.12.dev1/tests/test_rich_utils.py +38 -0
- typer_slim-0.12.dev1/tests/test_tracebacks.py +52 -0
- typer_slim-0.12.dev1/tests/test_tutorial/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_default/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_default/test_tutorial001.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_default/test_tutorial001_an.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_default/test_tutorial002.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_default/test_tutorial002_an.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_envvar/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001.py +61 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001_an.py +61 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002.py +48 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002_an.py +48 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003.py +48 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003_an.py +48 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial001.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial001_an.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial002.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial002_an.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial003.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial003_an.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial004.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial004_an.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial005.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial005_an.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial006.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial006_an.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial007.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial007_an.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial008.py +49 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_help/test_tutorial008_an.py +49 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_optional/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py +50 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_optional/test_tutorial001_an.py +50 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_optional/test_tutorial002.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_optional/test_tutorial002_an.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_arguments/test_optional/test_tutorial003.py +50 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_arguments/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_arguments/test_tutorial001.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_callback/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_callback/test_tutorial001.py +75 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_callback/test_tutorial002.py +26 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_callback/test_tutorial003.py +31 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_callback/test_tutorial004.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_context/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_context/test_tutorial001.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_context/test_tutorial002.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_context/test_tutorial003.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_context/test_tutorial004.py +28 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial001.py +109 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial001_an.py +109 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial002.py +56 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial003.py +44 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial004.py +59 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial004_an.py +59 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial005.py +60 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial005_an.py +60 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial006.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial007.py +55 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial007_an.py +55 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_help/test_tutorial008.py +32 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_index/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_index/test_tutorial001.py +31 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_index/test_tutorial002.py +40 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_index/test_tutorial003.py +40 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_name/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_name/test_tutorial001.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_one_or_multiple/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial001.py +32 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial002.py +34 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_options/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_options/test_tutorial001.py +76 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_commands/test_options/test_tutorial001_an.py +76 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_exceptions/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_exceptions/test_tutorial001.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_exceptions/test_tutorial002.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_exceptions/test_tutorial003.py +35 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_exceptions/test_tutorial004.py +34 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_first_steps/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_first_steps/test_tutorial001.py +25 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_first_steps/test_tutorial002.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_first_steps/test_tutorial003.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_first_steps/test_tutorial004.py +57 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_first_steps/test_tutorial005.py +57 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_first_steps/test_tutorial006.py +52 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial001.py +27 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py +50 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py +52 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_multiple_options/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001.py +44 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001_an.py +44 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002_an.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001_an.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_callback/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_callback/test_tutorial001.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_callback/test_tutorial001_an.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_callback/test_tutorial003.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_callback/test_tutorial003_an.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_callback/test_tutorial004.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_callback/test_tutorial004_an.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_help/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_help/test_tutorial001.py +48 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_help/test_tutorial001_an.py +48 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_help/test_tutorial002.py +44 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_help/test_tutorial002_an.py +44 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_help/test_tutorial003.py +35 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_help/test_tutorial003_an.py +35 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial001.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial001_an.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial002.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial002_an.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial003.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial003_an.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial004.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial004_an.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial005.py +54 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_name/test_tutorial005_an.py +54 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_prompt/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_prompt/test_tutorial001.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_prompt/test_tutorial001_an.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_prompt/test_tutorial002.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_prompt/test_tutorial002_an.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_prompt/test_tutorial003.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_prompt/test_tutorial003_an.py +51 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_required/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_required/test_tutorial001.py +53 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_required/test_tutorial001_an.py +53 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_version/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_version/test_tutorial003.py +56 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options/test_version/test_tutorial003_an.py +56 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial002.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial002_an.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial003.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial003_an.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial004.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial004_an.py +41 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial007.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial007_an.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial008.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial008_an.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial009.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_options_autocompletion/test_tutorial009_an.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001.py +46 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001_an.py +46 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002.py +65 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002_an.py +65 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003_an.py +42 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004.py +46 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004_an.py +46 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_custom_types/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001_an.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial002.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial002_an.py +38 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_datetime/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002_an.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_enum/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py +53 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002_an.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial003.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial003_an.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001.py +32 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001_an.py +32 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002.py +34 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002_an.py +34 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003.py +31 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003_an.py +31 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004.py +35 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004_an.py +35 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005.py +37 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005_an.py +37 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_index/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_number/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py +82 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001_an.py +82 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002.py +37 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002_an.py +37 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003.py +57 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003_an.py +57 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_path/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001.py +54 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001_an.py +54 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002_an.py +47 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_uuid/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py +37 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_prompt/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_prompt/test_tutorial001.py +28 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_prompt/test_tutorial002.py +36 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_prompt/test_tutorial003.py +35 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_callback_override/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial001.py +26 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial002.py +26 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial003.py +31 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial004.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial001.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial002.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial003.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial004.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial005.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial006.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial007.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial008.py +39 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_tutorial001.py +99 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_tutorial002.py +77 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_subcommands/test_tutorial003.py +172 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_terminating/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_terminating/test_tutorial001.py +43 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_terminating/test_tutorial002.py +33 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_terminating/test_tutorial003.py +52 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_testing/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_testing/test_app01.py +18 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_testing/test_app02.py +18 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_testing/test_app02_an.py +18 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_testing/test_app03.py +18 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_using_click/__init__.py +0 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_using_click/test_tutorial003.py +40 -0
- typer_slim-0.12.dev1/tests/test_tutorial/test_using_click/test_tutorial004.py +39 -0
- typer_slim-0.12.dev1/tests/test_type_conversion.py +130 -0
- typer_slim-0.12.dev1/tests/utils.py +7 -0
- typer_slim-0.12.dev1/typer/__init__.py +39 -0
- typer_slim-0.12.dev1/typer/__main__.py +3 -0
- typer_slim-0.12.dev1/typer/_completion_classes.py +192 -0
- typer_slim-0.12.dev1/typer/_completion_shared.py +240 -0
- typer_slim-0.12.dev1/typer/_typing.py +630 -0
- typer_slim-0.12.dev1/typer/cli.py +292 -0
- typer_slim-0.12.dev1/typer/colors.py +20 -0
- typer_slim-0.12.dev1/typer/completion.py +149 -0
- typer_slim-0.12.dev1/typer/core.py +740 -0
- typer_slim-0.12.dev1/typer/main.py +1063 -0
- typer_slim-0.12.dev1/typer/models.py +519 -0
- typer_slim-0.12.dev1/typer/params.py +468 -0
- typer_slim-0.12.dev1/typer/py.typed +0 -0
- typer_slim-0.12.dev1/typer/rich_utils.py +689 -0
- typer_slim-0.12.dev1/typer/testing.py +29 -0
- typer_slim-0.12.dev1/typer/utils.py +192 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Sebastián Ramírez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: typer-slim
|
|
3
|
+
Version: 0.12.dev1
|
|
4
|
+
Summary: Typer, build great CLIs. Easy to code. Based on Python type hints.
|
|
5
|
+
Home-page: https://github.com/tiangolo/typer
|
|
6
|
+
Author-Email: Sebastián Ramírez <tiangolo@gmail.com>
|
|
7
|
+
Classifier: Intended Audience :: Information Technology
|
|
8
|
+
Classifier: Intended Audience :: System Administrators
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
15
|
+
Classifier: Topic :: Software Development
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Classifier: Development Status :: 4 - Beta
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
26
|
+
Project-URL: Documentation, https://typer.tiangolo.com/
|
|
27
|
+
Project-URL: Homepage, https://github.com/tiangolo/typer
|
|
28
|
+
Requires-Python: >=3.7
|
|
29
|
+
Requires-Dist: click>=8.0.0
|
|
30
|
+
Requires-Dist: typing-extensions>=3.7.4.3
|
|
31
|
+
Requires-Dist: shellingham>=1.3.0; extra == "all"
|
|
32
|
+
Requires-Dist: rich>=10.11.0; extra == "all"
|
|
33
|
+
Requires-Dist: shellingham>=1.3.0; extra == "standard"
|
|
34
|
+
Requires-Dist: rich>=10.11.0; extra == "standard"
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Provides-Extra: standard
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
<p align="center">
|
|
40
|
+
<a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" alt="Typer"></a>
|
|
41
|
+
</p>
|
|
42
|
+
<p align="center">
|
|
43
|
+
<em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>
|
|
44
|
+
</p>
|
|
45
|
+
<p align="center">
|
|
46
|
+
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3ATest" target="_blank">
|
|
47
|
+
<img src="https://github.com/tiangolo/typer/workflows/Test/badge.svg" alt="Test">
|
|
48
|
+
</a>
|
|
49
|
+
<a href="https://github.com/tiangolo/typer/actions?query=workflow%3APublish" target="_blank">
|
|
50
|
+
<img src="https://github.com/tiangolo/typer/workflows/Publish/badge.svg" alt="Publish">
|
|
51
|
+
</a>
|
|
52
|
+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/typer" target="_blank">
|
|
53
|
+
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/typer.svg" alt="Coverage">
|
|
54
|
+
<a href="https://pypi.org/project/typer" target="_blank">
|
|
55
|
+
<img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">
|
|
56
|
+
</a>
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com</a>
|
|
62
|
+
|
|
63
|
+
**Source Code**: <a href="https://github.com/tiangolo/typer" target="_blank">https://github.com/tiangolo/typer</a>
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.
|
|
68
|
+
|
|
69
|
+
It's also a command line tool to run scripts, automatically converting them to CLI applications.
|
|
70
|
+
|
|
71
|
+
The key features are:
|
|
72
|
+
|
|
73
|
+
* **Intuitive to write**: Great editor support. <abbr title="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs.
|
|
74
|
+
* **Easy to use**: It's easy to use for the final users. Automatic help, and automatic completion for all shells.
|
|
75
|
+
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
|
|
76
|
+
* **Start simple**: The simplest example adds only 2 lines of code to your app: **1 import, 1 function call**.
|
|
77
|
+
* **Grow large**: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.
|
|
78
|
+
* **Run scripts**: Typer includes a `typer` command that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.
|
|
79
|
+
|
|
80
|
+
## FastAPI of CLIs
|
|
81
|
+
|
|
82
|
+
**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
<div class="termy">
|
|
87
|
+
|
|
88
|
+
```console
|
|
89
|
+
$ pip install typer
|
|
90
|
+
---> 100%
|
|
91
|
+
Successfully installed typer rich shellingham
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
## Example
|
|
97
|
+
|
|
98
|
+
### The absolute minimum
|
|
99
|
+
|
|
100
|
+
* Create a file `main.py` with:
|
|
101
|
+
|
|
102
|
+
```Python
|
|
103
|
+
def main(name: str):
|
|
104
|
+
print(f"Hello {name}")
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
This script doesn't even use Typer internally. But you can use the `typer` command to run it as a CLI application.
|
|
108
|
+
|
|
109
|
+
### Run it
|
|
110
|
+
|
|
111
|
+
Run your application with the `typer` command:
|
|
112
|
+
|
|
113
|
+
<div class="termy">
|
|
114
|
+
|
|
115
|
+
```console
|
|
116
|
+
// Run your application
|
|
117
|
+
$ typer main.py run
|
|
118
|
+
|
|
119
|
+
// You get a nice error, you are missing NAME
|
|
120
|
+
Usage: typer [PATH_OR_MODULE] run [OPTIONS] NAME
|
|
121
|
+
Try 'typer [PATH_OR_MODULE] run --help' for help.
|
|
122
|
+
╭─ Error ───────────────────────────────────────────╮
|
|
123
|
+
│ Missing argument 'NAME'. │
|
|
124
|
+
╰───────────────────────────────────────────────────╯
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
// You get a --help for free
|
|
128
|
+
$ typer main.py run --help
|
|
129
|
+
|
|
130
|
+
Usage: typer [PATH_OR_MODULE] run [OPTIONS] NAME
|
|
131
|
+
|
|
132
|
+
Run the provided Typer app.
|
|
133
|
+
|
|
134
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
135
|
+
│ * name TEXT [default: None] [required] |
|
|
136
|
+
╰───────────────────────────────────────────────────╯
|
|
137
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
138
|
+
│ --help Show this message and exit. │
|
|
139
|
+
╰───────────────────────────────────────────────────╯
|
|
140
|
+
|
|
141
|
+
// Now pass the NAME argument
|
|
142
|
+
$ typer main.py run Camila
|
|
143
|
+
|
|
144
|
+
Hello Camila
|
|
145
|
+
|
|
146
|
+
// It works! 🎉
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
This is the simplest use case, not even using Typer internally, but it can already be quite useful for simple scripts.
|
|
152
|
+
|
|
153
|
+
**Note**: auto-completion works when you create a Python package and run it with `--install-completion` or when you use the `typer` command.
|
|
154
|
+
|
|
155
|
+
## Use Typer in your code
|
|
156
|
+
|
|
157
|
+
Now let's start using Typer in your own code, update `main.py` with:
|
|
158
|
+
|
|
159
|
+
```Python
|
|
160
|
+
import typer
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def main(name: str):
|
|
164
|
+
print(f"Hello {name}")
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
if __name__ == "__main__":
|
|
168
|
+
typer.run(main)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Now you could run it with Python directly:
|
|
172
|
+
|
|
173
|
+
<div class="termy">
|
|
174
|
+
|
|
175
|
+
```console
|
|
176
|
+
// Run your application
|
|
177
|
+
$ python main.py
|
|
178
|
+
|
|
179
|
+
// You get a nice error, you are missing NAME
|
|
180
|
+
Usage: main.py [OPTIONS] NAME
|
|
181
|
+
Try 'main.py --help' for help.
|
|
182
|
+
╭─ Error ───────────────────────────────────────────╮
|
|
183
|
+
│ Missing argument 'NAME'. │
|
|
184
|
+
╰───────────────────────────────────────────────────╯
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
// You get a --help for free
|
|
188
|
+
$ python main.py --help
|
|
189
|
+
|
|
190
|
+
Usage: main.py [OPTIONS] NAME
|
|
191
|
+
|
|
192
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
193
|
+
│ * name TEXT [default: None] [required] |
|
|
194
|
+
╰───────────────────────────────────────────────────╯
|
|
195
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
196
|
+
│ --help Show this message and exit. │
|
|
197
|
+
╰───────────────────────────────────────────────────╯
|
|
198
|
+
|
|
199
|
+
// Now pass the NAME argument
|
|
200
|
+
$ python main.py Camila
|
|
201
|
+
|
|
202
|
+
Hello Camila
|
|
203
|
+
|
|
204
|
+
// It works! 🎉
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
**Note**: you can also call this same script with the `typer` command, but you don't need to.
|
|
210
|
+
|
|
211
|
+
## Example upgrade
|
|
212
|
+
|
|
213
|
+
This was the simplest example possible.
|
|
214
|
+
|
|
215
|
+
Now let's see one a bit more complex.
|
|
216
|
+
|
|
217
|
+
### An example with two subcommands
|
|
218
|
+
|
|
219
|
+
Modify the file `main.py`.
|
|
220
|
+
|
|
221
|
+
Create a `typer.Typer()` app, and create two subcommands with their parameters.
|
|
222
|
+
|
|
223
|
+
```Python hl_lines="3 6 11 20"
|
|
224
|
+
import typer
|
|
225
|
+
|
|
226
|
+
app = typer.Typer()
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
@app.command()
|
|
230
|
+
def hello(name: str):
|
|
231
|
+
print(f"Hello {name}")
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
@app.command()
|
|
235
|
+
def goodbye(name: str, formal: bool = False):
|
|
236
|
+
if formal:
|
|
237
|
+
print(f"Goodbye Ms. {name}. Have a good day.")
|
|
238
|
+
else:
|
|
239
|
+
print(f"Bye {name}!")
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
if __name__ == "__main__":
|
|
243
|
+
app()
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
And that will:
|
|
247
|
+
|
|
248
|
+
* Explicitly create a `typer.Typer` app.
|
|
249
|
+
* The previous `typer.run` actually creates one implicitly for you.
|
|
250
|
+
* Add two subcommands with `@app.command()`.
|
|
251
|
+
* Execute the `app()` itself, as if it was a function (instead of `typer.run`).
|
|
252
|
+
|
|
253
|
+
### Run the upgraded example
|
|
254
|
+
|
|
255
|
+
Check the new help:
|
|
256
|
+
|
|
257
|
+
<div class="termy">
|
|
258
|
+
|
|
259
|
+
```console
|
|
260
|
+
$ python main.py --help
|
|
261
|
+
|
|
262
|
+
Usage: main.py [OPTIONS] COMMAND [ARGS]...
|
|
263
|
+
|
|
264
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
265
|
+
│ --install-completion Install completion │
|
|
266
|
+
│ for the current │
|
|
267
|
+
│ shell. │
|
|
268
|
+
│ --show-completion Show completion for │
|
|
269
|
+
│ the current shell, │
|
|
270
|
+
│ to copy it or │
|
|
271
|
+
│ customize the │
|
|
272
|
+
│ installation. │
|
|
273
|
+
│ --help Show this message │
|
|
274
|
+
│ and exit. │
|
|
275
|
+
╰───────────────────────────────────────────────────╯
|
|
276
|
+
╭─ Commands ────────────────────────────────────────╮
|
|
277
|
+
│ goodbye │
|
|
278
|
+
│ hello │
|
|
279
|
+
╰───────────────────────────────────────────────────╯
|
|
280
|
+
|
|
281
|
+
// When you create a package you get ✨ auto-completion ✨ for free, installed with --install-completion
|
|
282
|
+
|
|
283
|
+
// You have 2 subcommands (the 2 functions): goodbye and hello
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
Now check the help for the `hello` command:
|
|
289
|
+
|
|
290
|
+
<div class="termy">
|
|
291
|
+
|
|
292
|
+
```console
|
|
293
|
+
$ python main.py hello --help
|
|
294
|
+
|
|
295
|
+
Usage: main.py hello [OPTIONS] NAME
|
|
296
|
+
|
|
297
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
298
|
+
│ * name TEXT [default: None] [required] │
|
|
299
|
+
╰───────────────────────────────────────────────────╯
|
|
300
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
301
|
+
│ --help Show this message and exit. │
|
|
302
|
+
╰───────────────────────────────────────────────────╯
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
And now check the help for the `goodbye` command:
|
|
308
|
+
|
|
309
|
+
<div class="termy">
|
|
310
|
+
|
|
311
|
+
```console
|
|
312
|
+
$ python main.py goodbye --help
|
|
313
|
+
|
|
314
|
+
Usage: main.py goodbye [OPTIONS] NAME
|
|
315
|
+
|
|
316
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
317
|
+
│ * name TEXT [default: None] [required] │
|
|
318
|
+
╰───────────────────────────────────────────────────╯
|
|
319
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
320
|
+
│ --formal --no-formal [default: no-formal] │
|
|
321
|
+
│ --help Show this message │
|
|
322
|
+
│ and exit. │
|
|
323
|
+
╰───────────────────────────────────────────────────╯
|
|
324
|
+
|
|
325
|
+
// Automatic --formal and --no-formal for the bool option 🎉
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
</div>
|
|
329
|
+
|
|
330
|
+
Now you can try out the new command line application:
|
|
331
|
+
|
|
332
|
+
<div class="termy">
|
|
333
|
+
|
|
334
|
+
```console
|
|
335
|
+
// Use it with the hello command
|
|
336
|
+
|
|
337
|
+
$ python main.py hello Camila
|
|
338
|
+
|
|
339
|
+
Hello Camila
|
|
340
|
+
|
|
341
|
+
// And with the goodbye command
|
|
342
|
+
|
|
343
|
+
$ python main.py goodbye Camila
|
|
344
|
+
|
|
345
|
+
Bye Camila!
|
|
346
|
+
|
|
347
|
+
// And with --formal
|
|
348
|
+
|
|
349
|
+
$ python main.py goodbye --formal Camila
|
|
350
|
+
|
|
351
|
+
Goodbye Ms. Camila. Have a good day.
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
</div>
|
|
355
|
+
|
|
356
|
+
### Recap
|
|
357
|
+
|
|
358
|
+
In summary, you declare **once** the types of parameters (*CLI arguments* and *CLI options*) as function parameters.
|
|
359
|
+
|
|
360
|
+
You do that with standard modern Python types.
|
|
361
|
+
|
|
362
|
+
You don't have to learn a new syntax, the methods or classes of a specific library, etc.
|
|
363
|
+
|
|
364
|
+
Just standard **Python**.
|
|
365
|
+
|
|
366
|
+
For example, for an `int`:
|
|
367
|
+
|
|
368
|
+
```Python
|
|
369
|
+
total: int
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
or for a `bool` flag:
|
|
373
|
+
|
|
374
|
+
```Python
|
|
375
|
+
force: bool
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
And similarly for **files**, **paths**, **enums** (choices), etc. And there are tools to create **groups of subcommands**, add metadata, extra **validation**, etc.
|
|
379
|
+
|
|
380
|
+
**You get**: great editor support, including **completion** and **type checks** everywhere.
|
|
381
|
+
|
|
382
|
+
**Your users get**: automatic **`--help`**, **auto-completion** in their terminal (Bash, Zsh, Fish, PowerShell) when they install your package or when using the `typer` command.
|
|
383
|
+
|
|
384
|
+
For a more complete example including more features, see the <a href="https://typer.tiangolo.com/tutorial/">Tutorial - User Guide</a>.
|
|
385
|
+
|
|
386
|
+
## Dependencies
|
|
387
|
+
|
|
388
|
+
**Typer** stands on the shoulders of a giant. Its only internal required dependency is <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>.
|
|
389
|
+
|
|
390
|
+
By default it also comes with extra standard dependencies:
|
|
391
|
+
|
|
392
|
+
* <a href="https://rich.readthedocs.io/en/stable/index.html" class="external-link" target="_blank"><code>rich</code></a>: to show nicely formatted errors automatically.
|
|
393
|
+
* <a href="https://github.com/sarugaku/shellingham" class="external-link" target="_blank"><code>shellingham</code></a>: to automatically detect the current shell when installing completion.
|
|
394
|
+
* With `shellingham` you can just use `--install-completion`.
|
|
395
|
+
* Without `shellingham`, you have to pass the name of the shell to install completion for, e.g. `--install-completion bash`.
|
|
396
|
+
* `typer-cli`: adds the `typer` command to your shell:
|
|
397
|
+
* Quickly run scripts (that don't have to use Typer) with shell completion.
|
|
398
|
+
* Generate docs for your Typer applications.
|
|
399
|
+
|
|
400
|
+
### `typer-slim`
|
|
401
|
+
|
|
402
|
+
If you don't want the extra dependencies, install `typer-slim` instead.
|
|
403
|
+
|
|
404
|
+
When you install with:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
pip install typer
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
...it's the equivalent of:
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
pip install "typer-slim[standard]"
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
The `standard` extra dependencies are `rich`, `shellingham`, `typer-cli`.
|
|
417
|
+
|
|
418
|
+
**Note**: even if you don't install `typer-cli` you can still use it's functionality by calling `typer` as a module, e.g. `python -m typer`.
|
|
419
|
+
|
|
420
|
+
## License
|
|
421
|
+
|
|
422
|
+
This project is licensed under the terms of the MIT license.
|