doctyper 0.15.2__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.
- doctyper-0.15.2/LICENSE +21 -0
- doctyper-0.15.2/PKG-INFO +471 -0
- doctyper-0.15.2/README.md +432 -0
- doctyper-0.15.2/docs_src/app_dir/tutorial001.py +16 -0
- doctyper-0.15.2/docs_src/arguments/default/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/arguments/default/tutorial001_an.py +10 -0
- doctyper-0.15.2/docs_src/arguments/default/tutorial002.py +15 -0
- doctyper-0.15.2/docs_src/arguments/default/tutorial002_an.py +16 -0
- doctyper-0.15.2/docs_src/arguments/envvar/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/arguments/envvar/tutorial001_an.py +10 -0
- doctyper-0.15.2/docs_src/arguments/envvar/tutorial002.py +9 -0
- doctyper-0.15.2/docs_src/arguments/envvar/tutorial002_an.py +14 -0
- doctyper-0.15.2/docs_src/arguments/envvar/tutorial003.py +11 -0
- doctyper-0.15.2/docs_src/arguments/envvar/tutorial003_an.py +14 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial001_an.py +12 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial002.py +12 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial002_an.py +15 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial003.py +12 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial003_an.py +13 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial004.py +14 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial004_an.py +17 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial005.py +13 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial005_an.py +17 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial006.py +9 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial006_an.py +10 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial007.py +20 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial007_an.py +23 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial008.py +12 -0
- doctyper-0.15.2/docs_src/arguments/help/tutorial008_an.py +13 -0
- doctyper-0.15.2/docs_src/arguments/optional/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/arguments/optional/tutorial001_an.py +10 -0
- doctyper-0.15.2/docs_src/arguments/optional/tutorial002.py +9 -0
- doctyper-0.15.2/docs_src/arguments/optional/tutorial002_an.py +10 -0
- doctyper-0.15.2/docs_src/arguments/optional/tutorial003.py +9 -0
- doctyper-0.15.2/docs_src/commands/arguments/tutorial001.py +17 -0
- doctyper-0.15.2/docs_src/commands/callback/tutorial001.py +36 -0
- doctyper-0.15.2/docs_src/commands/callback/tutorial002.py +17 -0
- doctyper-0.15.2/docs_src/commands/callback/tutorial003.py +22 -0
- doctyper-0.15.2/docs_src/commands/callback/tutorial004.py +23 -0
- doctyper-0.15.2/docs_src/commands/context/tutorial001.py +25 -0
- doctyper-0.15.2/docs_src/commands/context/tutorial002.py +25 -0
- doctyper-0.15.2/docs_src/commands/context/tutorial003.py +26 -0
- doctyper-0.15.2/docs_src/commands/context/tutorial004.py +15 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial001.py +62 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial001_an.py +67 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial002.py +23 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial003.py +25 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial004.py +36 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial004_an.py +37 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial005.py +36 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial005_an.py +39 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial006.py +55 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial007.py +39 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial007_an.py +50 -0
- doctyper-0.15.2/docs_src/commands/help/tutorial008.py +15 -0
- doctyper-0.15.2/docs_src/commands/index/tutorial001.py +12 -0
- doctyper-0.15.2/docs_src/commands/index/tutorial002.py +17 -0
- doctyper-0.15.2/docs_src/commands/index/tutorial003.py +17 -0
- doctyper-0.15.2/docs_src/commands/index/tutorial004.py +17 -0
- doctyper-0.15.2/docs_src/commands/name/tutorial001.py +17 -0
- doctyper-0.15.2/docs_src/commands/one_or_multiple/tutorial001.py +17 -0
- doctyper-0.15.2/docs_src/commands/one_or_multiple/tutorial002.py +21 -0
- doctyper-0.15.2/docs_src/commands/options/tutorial001.py +42 -0
- doctyper-0.15.2/docs_src/commands/options/tutorial001_an.py +43 -0
- doctyper-0.15.2/docs_src/exceptions/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/exceptions/tutorial002.py +12 -0
- doctyper-0.15.2/docs_src/exceptions/tutorial003.py +12 -0
- doctyper-0.15.2/docs_src/exceptions/tutorial004.py +12 -0
- doctyper-0.15.2/docs_src/first_steps/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/first_steps/tutorial002.py +9 -0
- doctyper-0.15.2/docs_src/first_steps/tutorial003.py +9 -0
- doctyper-0.15.2/docs_src/first_steps/tutorial004.py +12 -0
- doctyper-0.15.2/docs_src/first_steps/tutorial005.py +12 -0
- doctyper-0.15.2/docs_src/first_steps/tutorial006.py +17 -0
- doctyper-0.15.2/docs_src/launch/tutorial001.py +10 -0
- doctyper-0.15.2/docs_src/launch/tutorial002.py +21 -0
- doctyper-0.15.2/docs_src/multiple_values/arguments_with_multiple_values/tutorial001.py +15 -0
- doctyper-0.15.2/docs_src/multiple_values/arguments_with_multiple_values/tutorial002.py +16 -0
- doctyper-0.15.2/docs_src/multiple_values/arguments_with_multiple_values/tutorial002_an.py +18 -0
- doctyper-0.15.2/docs_src/multiple_values/multiple_options/tutorial001.py +15 -0
- doctyper-0.15.2/docs_src/multiple_values/multiple_options/tutorial001_an.py +16 -0
- doctyper-0.15.2/docs_src/multiple_values/multiple_options/tutorial002.py +11 -0
- doctyper-0.15.2/docs_src/multiple_values/multiple_options/tutorial002_an.py +12 -0
- doctyper-0.15.2/docs_src/multiple_values/options_with_multiple_values/tutorial001.py +17 -0
- doctyper-0.15.2/docs_src/multiple_values/options_with_multiple_values/tutorial001_an.py +20 -0
- doctyper-0.15.2/docs_src/one_file_per_command/__init__.py +0 -0
- doctyper-0.15.2/docs_src/one_file_per_command/main.py +13 -0
- doctyper-0.15.2/docs_src/one_file_per_command/users/__init__.py +9 -0
- doctyper-0.15.2/docs_src/one_file_per_command/users/add.py +8 -0
- doctyper-0.15.2/docs_src/one_file_per_command/users/delete.py +8 -0
- doctyper-0.15.2/docs_src/one_file_per_command/version.py +8 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial001.py +17 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial001_an.py +20 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial002.py +18 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial002_an.py +21 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial003.py +20 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial003_an.py +23 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial004.py +20 -0
- doctyper-0.15.2/docs_src/options/callback/tutorial004_an.py +23 -0
- doctyper-0.15.2/docs_src/options/help/tutorial001.py +21 -0
- doctyper-0.15.2/docs_src/options/help/tutorial001_an.py +24 -0
- doctyper-0.15.2/docs_src/options/help/tutorial002.py +26 -0
- doctyper-0.15.2/docs_src/options/help/tutorial002_an.py +35 -0
- doctyper-0.15.2/docs_src/options/help/tutorial003.py +9 -0
- doctyper-0.15.2/docs_src/options/help/tutorial003_an.py +12 -0
- doctyper-0.15.2/docs_src/options/help/tutorial004.py +13 -0
- doctyper-0.15.2/docs_src/options/help/tutorial004_an.py +14 -0
- doctyper-0.15.2/docs_src/options/name/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/options/name/tutorial001_an.py +10 -0
- doctyper-0.15.2/docs_src/options/name/tutorial002.py +9 -0
- doctyper-0.15.2/docs_src/options/name/tutorial002_an.py +10 -0
- doctyper-0.15.2/docs_src/options/name/tutorial003.py +9 -0
- doctyper-0.15.2/docs_src/options/name/tutorial003_an.py +10 -0
- doctyper-0.15.2/docs_src/options/name/tutorial004.py +9 -0
- doctyper-0.15.2/docs_src/options/name/tutorial004_an.py +10 -0
- doctyper-0.15.2/docs_src/options/name/tutorial005.py +15 -0
- doctyper-0.15.2/docs_src/options/name/tutorial005_an.py +16 -0
- doctyper-0.15.2/docs_src/options/password/tutorial001.py +11 -0
- doctyper-0.15.2/docs_src/options/password/tutorial001_an.py +13 -0
- doctyper-0.15.2/docs_src/options/password/tutorial002.py +15 -0
- doctyper-0.15.2/docs_src/options/password/tutorial002_an.py +16 -0
- doctyper-0.15.2/docs_src/options/prompt/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/options/prompt/tutorial001_an.py +10 -0
- doctyper-0.15.2/docs_src/options/prompt/tutorial002.py +12 -0
- doctyper-0.15.2/docs_src/options/prompt/tutorial002_an.py +13 -0
- doctyper-0.15.2/docs_src/options/prompt/tutorial003.py +11 -0
- doctyper-0.15.2/docs_src/options/prompt/tutorial003_an.py +14 -0
- doctyper-0.15.2/docs_src/options/required/tutorial001.py +9 -0
- doctyper-0.15.2/docs_src/options/required/tutorial001_an.py +10 -0
- doctyper-0.15.2/docs_src/options/required/tutorial002.py +9 -0
- doctyper-0.15.2/docs_src/options/version/tutorial001.py +24 -0
- doctyper-0.15.2/docs_src/options/version/tutorial001_an.py +25 -0
- doctyper-0.15.2/docs_src/options/version/tutorial002.py +29 -0
- doctyper-0.15.2/docs_src/options/version/tutorial002_an.py +30 -0
- doctyper-0.15.2/docs_src/options/version/tutorial003.py +30 -0
- doctyper-0.15.2/docs_src/options/version/tutorial003_an.py +32 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial001.py +12 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial001_an.py +15 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial002.py +21 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial002_an.py +23 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial003.py +27 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial003_an.py +29 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial004.py +32 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial004_an.py +34 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial005.py +29 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial005_an.py +31 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial006.py +15 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial006_an.py +20 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial007.py +33 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial007_an.py +35 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial008.py +36 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial008_an.py +38 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial009.py +37 -0
- doctyper-0.15.2/docs_src/options_autocompletion/tutorial009_an.py +39 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial001.py +12 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial001_an.py +13 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial002.py +16 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial002_an.py +19 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial003.py +12 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial003_an.py +15 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial004.py +12 -0
- doctyper-0.15.2/docs_src/parameter_types/bool/tutorial004_an.py +13 -0
- doctyper-0.15.2/docs_src/parameter_types/custom_types/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/custom_types/tutorial001.py +25 -0
- doctyper-0.15.2/docs_src/parameter_types/custom_types/tutorial001_an.py +28 -0
- doctyper-0.15.2/docs_src/parameter_types/custom_types/tutorial002.py +29 -0
- doctyper-0.15.2/docs_src/parameter_types/custom_types/tutorial002_an.py +34 -0
- doctyper-0.15.2/docs_src/parameter_types/datetime/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/datetime/tutorial001.py +12 -0
- doctyper-0.15.2/docs_src/parameter_types/datetime/tutorial002.py +15 -0
- doctyper-0.15.2/docs_src/parameter_types/datetime/tutorial002_an.py +19 -0
- doctyper-0.15.2/docs_src/parameter_types/enum/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/enum/tutorial001.py +17 -0
- doctyper-0.15.2/docs_src/parameter_types/enum/tutorial002.py +21 -0
- doctyper-0.15.2/docs_src/parameter_types/enum/tutorial002_an.py +22 -0
- doctyper-0.15.2/docs_src/parameter_types/enum/tutorial003.py +18 -0
- doctyper-0.15.2/docs_src/parameter_types/enum/tutorial003_an.py +21 -0
- doctyper-0.15.2/docs_src/parameter_types/file/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial001.py +10 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial001_an.py +11 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial002.py +10 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial002_an.py +11 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial003.py +13 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial003_an.py +14 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial004.py +17 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial004_an.py +18 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial005.py +10 -0
- doctyper-0.15.2/docs_src/parameter_types/file/tutorial005_an.py +11 -0
- doctyper-0.15.2/docs_src/parameter_types/index/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/index/tutorial001.py +12 -0
- doctyper-0.15.2/docs_src/parameter_types/number/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/number/tutorial001.py +15 -0
- doctyper-0.15.2/docs_src/parameter_types/number/tutorial001_an.py +16 -0
- doctyper-0.15.2/docs_src/parameter_types/number/tutorial002.py +15 -0
- doctyper-0.15.2/docs_src/parameter_types/number/tutorial002_an.py +16 -0
- doctyper-0.15.2/docs_src/parameter_types/number/tutorial003.py +9 -0
- doctyper-0.15.2/docs_src/parameter_types/number/tutorial003_an.py +10 -0
- doctyper-0.15.2/docs_src/parameter_types/path/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/path/tutorial001.py +21 -0
- doctyper-0.15.2/docs_src/parameter_types/path/tutorial001_an.py +22 -0
- doctyper-0.15.2/docs_src/parameter_types/path/tutorial002.py +22 -0
- doctyper-0.15.2/docs_src/parameter_types/path/tutorial002_an.py +25 -0
- doctyper-0.15.2/docs_src/parameter_types/uuid/__init__.py +0 -0
- doctyper-0.15.2/docs_src/parameter_types/uuid/tutorial001.py +12 -0
- doctyper-0.15.2/docs_src/printing/tutorial001.py +19 -0
- doctyper-0.15.2/docs_src/printing/tutorial002.py +10 -0
- doctyper-0.15.2/docs_src/printing/tutorial003.py +16 -0
- doctyper-0.15.2/docs_src/printing/tutorial004.py +12 -0
- doctyper-0.15.2/docs_src/printing/tutorial005.py +15 -0
- doctyper-0.15.2/docs_src/printing/tutorial006.py +9 -0
- doctyper-0.15.2/docs_src/progressbar/tutorial001.py +17 -0
- doctyper-0.15.2/docs_src/progressbar/tutorial002.py +20 -0
- doctyper-0.15.2/docs_src/progressbar/tutorial003.py +17 -0
- doctyper-0.15.2/docs_src/progressbar/tutorial004.py +23 -0
- doctyper-0.15.2/docs_src/progressbar/tutorial005.py +17 -0
- doctyper-0.15.2/docs_src/progressbar/tutorial006.py +19 -0
- doctyper-0.15.2/docs_src/prompt/tutorial001.py +10 -0
- doctyper-0.15.2/docs_src/prompt/tutorial002.py +13 -0
- doctyper-0.15.2/docs_src/prompt/tutorial003.py +10 -0
- doctyper-0.15.2/docs_src/prompt/tutorial004.py +11 -0
- doctyper-0.15.2/docs_src/subcommands/callback_override/tutorial001.py +20 -0
- doctyper-0.15.2/docs_src/subcommands/callback_override/tutorial002.py +20 -0
- doctyper-0.15.2/docs_src/subcommands/callback_override/tutorial003.py +25 -0
- doctyper-0.15.2/docs_src/subcommands/callback_override/tutorial004.py +31 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial001.py +15 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial002.py +22 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial003.py +22 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial004.py +29 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial005.py +37 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial006.py +39 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial007.py +37 -0
- doctyper-0.15.2/docs_src/subcommands/name_help/tutorial008.py +44 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial001/__init__.py +0 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial001/items.py +22 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial001/main.py +11 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial001/users.py +17 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial002/main.py +36 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial003/__init__.py +0 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial003/items.py +22 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial003/lands.py +11 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial003/main.py +13 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial003/reigns.py +17 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial003/towns.py +17 -0
- doctyper-0.15.2/docs_src/subcommands/tutorial003/users.py +17 -0
- doctyper-0.15.2/docs_src/terminating/tutorial001.py +25 -0
- doctyper-0.15.2/docs_src/terminating/tutorial002.py +12 -0
- doctyper-0.15.2/docs_src/terminating/tutorial003.py +12 -0
- doctyper-0.15.2/docs_src/testing/app01/__init__.py +0 -0
- doctyper-0.15.2/docs_src/testing/app01/main.py +16 -0
- doctyper-0.15.2/docs_src/testing/app01/test_main.py +12 -0
- doctyper-0.15.2/docs_src/testing/app02/__init__.py +0 -0
- doctyper-0.15.2/docs_src/testing/app02/main.py +12 -0
- doctyper-0.15.2/docs_src/testing/app02/test_main.py +11 -0
- doctyper-0.15.2/docs_src/testing/app02_an/__init__.py +0 -0
- doctyper-0.15.2/docs_src/testing/app02_an/main.py +13 -0
- doctyper-0.15.2/docs_src/testing/app02_an/test_main.py +11 -0
- doctyper-0.15.2/docs_src/testing/app03/__init__.py +0 -0
- doctyper-0.15.2/docs_src/testing/app03/main.py +9 -0
- doctyper-0.15.2/docs_src/testing/app03/test_main.py +15 -0
- doctyper-0.15.2/docs_src/using_click/tutorial001.py +14 -0
- doctyper-0.15.2/docs_src/using_click/tutorial002.py +24 -0
- doctyper-0.15.2/docs_src/using_click/tutorial003.py +34 -0
- doctyper-0.15.2/docs_src/using_click/tutorial004.py +36 -0
- doctyper-0.15.2/doctyper/__init__.py +40 -0
- doctyper-0.15.2/doctyper/__main__.py +3 -0
- doctyper-0.15.2/doctyper/_completion_classes.py +203 -0
- doctyper-0.15.2/doctyper/_completion_shared.py +240 -0
- doctyper-0.15.2/doctyper/_typing.py +113 -0
- doctyper-0.15.2/doctyper/cli.py +317 -0
- doctyper-0.15.2/doctyper/colors.py +20 -0
- doctyper-0.15.2/doctyper/completion.py +149 -0
- doctyper-0.15.2/doctyper/core.py +764 -0
- doctyper-0.15.2/doctyper/main.py +1174 -0
- doctyper-0.15.2/doctyper/models.py +544 -0
- doctyper-0.15.2/doctyper/params.py +479 -0
- doctyper-0.15.2/doctyper/py.typed +0 -0
- doctyper-0.15.2/doctyper/rich_utils.py +735 -0
- doctyper-0.15.2/doctyper/testing.py +29 -0
- doctyper-0.15.2/doctyper/utils.py +215 -0
- doctyper-0.15.2/pdm_build.py +55 -0
- doctyper-0.15.2/pyproject.toml +234 -0
- doctyper-0.15.2/requirements-docs-insiders.txt +3 -0
- doctyper-0.15.2/requirements-docs.txt +19 -0
- doctyper-0.15.2/requirements-github-actions.txt +5 -0
- doctyper-0.15.2/requirements-tests.txt +12 -0
- doctyper-0.15.2/requirements.txt +6 -0
- doctyper-0.15.2/scripts/deploy_docs_status.py +103 -0
- doctyper-0.15.2/scripts/docker/Dockerfile +28 -0
- doctyper-0.15.2/scripts/docker/compose.yaml +8 -0
- doctyper-0.15.2/scripts/docs.py +135 -0
- doctyper-0.15.2/scripts/format.sh +6 -0
- doctyper-0.15.2/scripts/get-pwsh-activate.sh +1 -0
- doctyper-0.15.2/scripts/lint.sh +8 -0
- doctyper-0.15.2/scripts/mkdocs_hooks.py +38 -0
- doctyper-0.15.2/scripts/test-cov-html.sh +6 -0
- doctyper-0.15.2/scripts/test-files.sh +8 -0
- doctyper-0.15.2/scripts/test.sh +13 -0
- doctyper-0.15.2/tests/__init__.py +0 -0
- doctyper-0.15.2/tests/assets/__init__.py +0 -0
- doctyper-0.15.2/tests/assets/cli/__init__.py +0 -0
- doctyper-0.15.2/tests/assets/cli/app_other_name.py +8 -0
- doctyper-0.15.2/tests/assets/cli/empty_script.py +0 -0
- doctyper-0.15.2/tests/assets/cli/extended_app_cli.py +31 -0
- doctyper-0.15.2/tests/assets/cli/extended_empty_app_cli.py +15 -0
- doctyper-0.15.2/tests/assets/cli/func_other_name.py +2 -0
- doctyper-0.15.2/tests/assets/cli/multi_app.py +42 -0
- doctyper-0.15.2/tests/assets/cli/multi_app_cli.py +22 -0
- doctyper-0.15.2/tests/assets/cli/multi_func.py +12 -0
- doctyper-0.15.2/tests/assets/cli/multiapp-docs-title.md +102 -0
- doctyper-0.15.2/tests/assets/cli/multiapp-docs.md +102 -0
- doctyper-0.15.2/tests/assets/cli/not_python.txt +1 -0
- doctyper-0.15.2/tests/assets/cli/rich_formatted_app.py +24 -0
- doctyper-0.15.2/tests/assets/cli/richformattedapp-docs.md +21 -0
- doctyper-0.15.2/tests/assets/cli/sample.py +25 -0
- doctyper-0.15.2/tests/assets/completion_argument.py +22 -0
- doctyper-0.15.2/tests/assets/completion_no_types.py +23 -0
- doctyper-0.15.2/tests/assets/completion_no_types_order.py +23 -0
- doctyper-0.15.2/tests/assets/corner_cases.py +19 -0
- doctyper-0.15.2/tests/assets/prog_name.py +12 -0
- doctyper-0.15.2/tests/assets/type_error_no_rich.py +11 -0
- doctyper-0.15.2/tests/assets/type_error_no_rich_short_disable.py +15 -0
- doctyper-0.15.2/tests/assets/type_error_normal_traceback.py +22 -0
- doctyper-0.15.2/tests/test_ambiguous_params.py +233 -0
- doctyper-0.15.2/tests/test_annotated.py +78 -0
- doctyper-0.15.2/tests/test_callback_warning.py +44 -0
- doctyper-0.15.2/tests/test_cli/__init__.py +0 -0
- doctyper-0.15.2/tests/test_cli/test_app_other_name.py +41 -0
- doctyper-0.15.2/tests/test_cli/test_completion_run.py +19 -0
- doctyper-0.15.2/tests/test_cli/test_doc.py +174 -0
- doctyper-0.15.2/tests/test_cli/test_empty_script.py +20 -0
- doctyper-0.15.2/tests/test_cli/test_extending_app.py +120 -0
- doctyper-0.15.2/tests/test_cli/test_extending_empty_app.py +59 -0
- doctyper-0.15.2/tests/test_cli/test_func_other_name.py +22 -0
- doctyper-0.15.2/tests/test_cli/test_help.py +38 -0
- doctyper-0.15.2/tests/test_cli/test_multi_app.py +123 -0
- doctyper-0.15.2/tests/test_cli/test_multi_app_cli.py +102 -0
- doctyper-0.15.2/tests/test_cli/test_multi_app_sub.py +46 -0
- doctyper-0.15.2/tests/test_cli/test_multi_func.py +106 -0
- doctyper-0.15.2/tests/test_cli/test_not_python.py +20 -0
- doctyper-0.15.2/tests/test_cli/test_sub.py +139 -0
- doctyper-0.15.2/tests/test_cli/test_sub_completion.py +19 -0
- doctyper-0.15.2/tests/test_cli/test_sub_help.py +24 -0
- doctyper-0.15.2/tests/test_cli/test_version.py +11 -0
- doctyper-0.15.2/tests/test_completion/__init__.py +0 -0
- doctyper-0.15.2/tests/test_completion/colon_example.py +25 -0
- doctyper-0.15.2/tests/test_completion/example_rich_tags.py +31 -0
- doctyper-0.15.2/tests/test_completion/path_example.py +14 -0
- doctyper-0.15.2/tests/test_completion/test_completion.py +164 -0
- doctyper-0.15.2/tests/test_completion/test_completion_complete.py +160 -0
- doctyper-0.15.2/tests/test_completion/test_completion_complete_no_help.py +63 -0
- doctyper-0.15.2/tests/test_completion/test_completion_complete_rich.py +113 -0
- doctyper-0.15.2/tests/test_completion/test_completion_install.py +172 -0
- doctyper-0.15.2/tests/test_completion/test_completion_option_colon.py +219 -0
- doctyper-0.15.2/tests/test_completion/test_completion_path.py +30 -0
- doctyper-0.15.2/tests/test_completion/test_completion_show.py +149 -0
- doctyper-0.15.2/tests/test_completion/test_sanitization.py +39 -0
- doctyper-0.15.2/tests/test_corner_cases.py +35 -0
- doctyper-0.15.2/tests/test_deprecation.py +27 -0
- doctyper-0.15.2/tests/test_doctyper.py +119 -0
- doctyper-0.15.2/tests/test_exit_errors.py +58 -0
- doctyper-0.15.2/tests/test_future_annotations.py +26 -0
- doctyper-0.15.2/tests/test_launch.py +51 -0
- doctyper-0.15.2/tests/test_others.py +280 -0
- doctyper-0.15.2/tests/test_param_meta_empty.py +36 -0
- doctyper-0.15.2/tests/test_prog_name.py +13 -0
- doctyper-0.15.2/tests/test_rich_markup_mode.py +288 -0
- doctyper-0.15.2/tests/test_rich_utils.py +52 -0
- doctyper-0.15.2/tests/test_tracebacks.py +52 -0
- doctyper-0.15.2/tests/test_tutorial/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_default/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_default/test_tutorial001.py +41 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_default/test_tutorial001_an.py +41 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_default/test_tutorial002.py +43 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_default/test_tutorial002_an.py +43 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_envvar/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001.py +61 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_envvar/test_tutorial001_an.py +61 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002.py +48 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_envvar/test_tutorial002_an.py +48 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003.py +48 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_envvar/test_tutorial003_an.py +48 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial001.py +51 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial001_an.py +51 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial002.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial002_an.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial003.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial003_an.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial004.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial004_an.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial005.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial005_an.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial006.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial006_an.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial007.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial007_an.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial008.py +49 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_help/test_tutorial008_an.py +49 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_optional/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_optional/test_tutorial001_an.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_optional/test_tutorial002.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_optional/test_tutorial002_an.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_arguments/test_optional/test_tutorial003.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_arguments/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_arguments/test_tutorial001.py +43 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_callback/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_callback/test_tutorial001.py +75 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_callback/test_tutorial002.py +26 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_callback/test_tutorial003.py +31 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_callback/test_tutorial004.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_context/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_context/test_tutorial001.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_context/test_tutorial002.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_context/test_tutorial003.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_context/test_tutorial004.py +28 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial001.py +109 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial001_an.py +109 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial002.py +56 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial003.py +44 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial004.py +61 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial004_an.py +61 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial005.py +62 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial005_an.py +62 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial006.py +53 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial007.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial007_an.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_help/test_tutorial008.py +32 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_index/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_index/test_tutorial001.py +31 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_index/test_tutorial002.py +40 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_index/test_tutorial003.py +40 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_index/test_tutorial004.py +45 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_name/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_name/test_tutorial001.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_one_or_multiple/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial001.py +32 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial002.py +34 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_options/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_options/test_tutorial001.py +76 -0
- doctyper-0.15.2/tests/test_tutorial/test_commands/test_options/test_tutorial001_an.py +76 -0
- doctyper-0.15.2/tests/test_tutorial/test_exceptions/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_exceptions/test_tutorial001.py +51 -0
- doctyper-0.15.2/tests/test_tutorial/test_exceptions/test_tutorial002.py +51 -0
- doctyper-0.15.2/tests/test_tutorial/test_exceptions/test_tutorial003.py +35 -0
- doctyper-0.15.2/tests/test_tutorial/test_exceptions/test_tutorial004.py +34 -0
- doctyper-0.15.2/tests/test_tutorial/test_first_steps/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_first_steps/test_tutorial001.py +25 -0
- doctyper-0.15.2/tests/test_tutorial/test_first_steps/test_tutorial002.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_first_steps/test_tutorial003.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_first_steps/test_tutorial004.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_first_steps/test_tutorial005.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_first_steps/test_tutorial006.py +52 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial001.py +27 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py +52 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_multiple_options/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001.py +44 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001_an.py +44 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002_an.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001_an.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_one_file_per_command/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_one_file_per_command/test_tutorial.py +44 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_callback/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_callback/test_tutorial001.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_callback/test_tutorial001_an.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_callback/test_tutorial003.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_callback/test_tutorial003_an.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_callback/test_tutorial004.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_callback/test_tutorial004_an.py +50 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_help/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_help/test_tutorial001.py +48 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_help/test_tutorial001_an.py +48 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_help/test_tutorial002.py +44 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_help/test_tutorial002_an.py +44 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_help/test_tutorial003.py +35 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_help/test_tutorial003_an.py +35 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial001.py +41 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial001_an.py +41 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial002.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial002_an.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial003.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial003_an.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial004.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial004_an.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial005.py +54 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_name/test_tutorial005_an.py +54 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_prompt/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_prompt/test_tutorial001.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_prompt/test_tutorial001_an.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_prompt/test_tutorial002.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_prompt/test_tutorial002_an.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_prompt/test_tutorial003.py +51 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_prompt/test_tutorial003_an.py +51 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_required/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_required/test_tutorial001.py +53 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_required/test_tutorial001_an.py +53 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_version/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_version/test_tutorial003.py +55 -0
- doctyper-0.15.2/tests/test_tutorial/test_options/test_version/test_tutorial003_an.py +55 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial002.py +40 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial002_an.py +40 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial003.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial003_an.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial004.py +40 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial004_an.py +40 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial007.py +41 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial007_an.py +41 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial008.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial008_an.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial009.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_options_autocompletion/test_tutorial009_an.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001.py +46 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001_an.py +46 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002.py +65 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002_an.py +65 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003_an.py +42 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004.py +46 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004_an.py +46 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_custom_types/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001_an.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial002.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial002_an.py +38 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_datetime/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002_an.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_enum/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py +53 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002_an.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial003.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial003_an.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001.py +32 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial001_an.py +32 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002.py +34 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial002_an.py +34 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003.py +31 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial003_an.py +31 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004.py +35 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial004_an.py +35 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005.py +37 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_file/test_tutorial005_an.py +37 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_index/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_number/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py +82 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001_an.py +82 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002.py +37 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_number/test_tutorial002_an.py +37 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_number/test_tutorial003_an.py +57 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_path/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001.py +54 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_path/test_tutorial001_an.py +54 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002_an.py +47 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_uuid/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py +37 -0
- doctyper-0.15.2/tests/test_tutorial/test_prompt/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_prompt/test_tutorial001.py +28 -0
- doctyper-0.15.2/tests/test_tutorial/test_prompt/test_tutorial002.py +36 -0
- doctyper-0.15.2/tests/test_tutorial/test_prompt/test_tutorial003.py +35 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_callback_override/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial001.py +26 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial002.py +26 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial003.py +31 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial004.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial001.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial002.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial003.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial004.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial005.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial006.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial007.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_name_help/test_tutorial008.py +39 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_tutorial001.py +99 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_tutorial002.py +77 -0
- doctyper-0.15.2/tests/test_tutorial/test_subcommands/test_tutorial003.py +172 -0
- doctyper-0.15.2/tests/test_tutorial/test_terminating/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_terminating/test_tutorial001.py +43 -0
- doctyper-0.15.2/tests/test_tutorial/test_terminating/test_tutorial002.py +33 -0
- doctyper-0.15.2/tests/test_tutorial/test_terminating/test_tutorial003.py +52 -0
- doctyper-0.15.2/tests/test_tutorial/test_testing/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_testing/test_app01.py +18 -0
- doctyper-0.15.2/tests/test_tutorial/test_testing/test_app02.py +18 -0
- doctyper-0.15.2/tests/test_tutorial/test_testing/test_app02_an.py +18 -0
- doctyper-0.15.2/tests/test_tutorial/test_testing/test_app03.py +18 -0
- doctyper-0.15.2/tests/test_tutorial/test_using_click/__init__.py +0 -0
- doctyper-0.15.2/tests/test_tutorial/test_using_click/test_tutorial003.py +40 -0
- doctyper-0.15.2/tests/test_tutorial/test_using_click/test_tutorial004.py +39 -0
- doctyper-0.15.2/tests/test_type_conversion.py +171 -0
- doctyper-0.15.2/tests/utils.py +33 -0
doctyper-0.15.2/LICENSE
ADDED
|
@@ -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.
|
doctyper-0.15.2/PKG-INFO
ADDED
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: doctyper
|
|
3
|
+
Version: 0.15.2
|
|
4
|
+
Summary: Wrapper around Typer using Google-Doc strings for CLI descriptions.
|
|
5
|
+
Author-Email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <tiangolo@gmail.com>
|
|
6
|
+
Classifier: Intended Audience :: Information Technology
|
|
7
|
+
Classifier: Intended Audience :: System Administrators
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
12
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
14
|
+
Classifier: Topic :: Software Development
|
|
15
|
+
Classifier: Typing :: Typed
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
27
|
+
Project-URL: Homepage, https://github.com/fastapi/typer
|
|
28
|
+
Project-URL: Documentation, https://typer.tiangolo.com
|
|
29
|
+
Project-URL: Repository, https://github.com/fastapi/typer
|
|
30
|
+
Project-URL: Issues, https://github.com/fastapi/typer/issues
|
|
31
|
+
Project-URL: Changelog, https://typer.tiangolo.com/release-notes/
|
|
32
|
+
Requires-Python: >=3.7
|
|
33
|
+
Requires-Dist: click>=8.0.0
|
|
34
|
+
Requires-Dist: docstring-parser
|
|
35
|
+
Requires-Dist: typing-extensions>=3.7.4.3
|
|
36
|
+
Requires-Dist: shellingham>=1.3.0
|
|
37
|
+
Requires-Dist: rich>=10.11.0
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# doctyper
|
|
41
|
+
|
|
42
|
+
A wrapper around [Typer](https://typer.tiangolo.com) to simplify the creation of command-line interfaces (CLIs).
|
|
43
|
+
It use parsed docstrings to extract the arguments and options for the CLI commands.
|
|
44
|
+
|
|
45
|
+
- Features:
|
|
46
|
+
- Use Google-style docstrings to create help strings for arguments and options.
|
|
47
|
+
- Use type-aliased identifiers
|
|
48
|
+
- Interpret Literals (for choices)
|
|
49
|
+
- `SlimTyper` disables completion and pretty traceback
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from typing import Literal
|
|
53
|
+
|
|
54
|
+
import doctyper
|
|
55
|
+
from typing_extensions import TypeAlias
|
|
56
|
+
|
|
57
|
+
Alias: TypeAlias = int
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def main(
|
|
61
|
+
arg: str,
|
|
62
|
+
alias: Alias, # output uses original name
|
|
63
|
+
lit_arg: Literal["arg", "other"], # only strings allowed for literals
|
|
64
|
+
lit_opt: Literal["opt", "other"] = "opt",
|
|
65
|
+
other: int = 1,
|
|
66
|
+
flag: bool = False,
|
|
67
|
+
) -> None:
|
|
68
|
+
"""Run the main application.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
arg: String argument.
|
|
72
|
+
alias: Argument using a aliased identifier.
|
|
73
|
+
other: Integer argument with default.
|
|
74
|
+
lit_arg: Argument with choices.
|
|
75
|
+
lit_opt: Option with choices and a default.
|
|
76
|
+
flag: Boolean flag.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if __name__ == "__main__":
|
|
81
|
+
app = doctyper.SlimTyper()
|
|
82
|
+
app.command()(main)
|
|
83
|
+
app()
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
<p align="center">
|
|
89
|
+
<a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg#only-light" alt="Typer"></a>
|
|
90
|
+
|
|
91
|
+
</p>
|
|
92
|
+
<p align="center">
|
|
93
|
+
<em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>
|
|
94
|
+
</p>
|
|
95
|
+
<p align="center">
|
|
96
|
+
<a href="https://github.com/fastapi/typer/actions?query=workflow%3ATest" target="_blank">
|
|
97
|
+
<img src="https://github.com/fastapi/typer/workflows/Test/badge.svg" alt="Test">
|
|
98
|
+
</a>
|
|
99
|
+
<a href="https://github.com/fastapi/typer/actions?query=workflow%3APublish" target="_blank">
|
|
100
|
+
<img src="https://github.com/fastapi/typer/workflows/Publish/badge.svg" alt="Publish">
|
|
101
|
+
</a>
|
|
102
|
+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/typer" target="_blank">
|
|
103
|
+
<img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/typer.svg" alt="Coverage">
|
|
104
|
+
<a href="https://pypi.org/project/typer" target="_blank">
|
|
105
|
+
<img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">
|
|
106
|
+
</a>
|
|
107
|
+
</p>
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com</a>
|
|
112
|
+
|
|
113
|
+
**Source Code**: <a href="https://github.com/fastapi/typer" target="_blank">https://github.com/fastapi/typer</a>
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
It's also a command line tool to run scripts, automatically converting them to CLI applications.
|
|
120
|
+
|
|
121
|
+
The key features are:
|
|
122
|
+
|
|
123
|
+
* **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.
|
|
124
|
+
* **Easy to use**: It's easy to use for the final users. Automatic help, and automatic completion for all shells.
|
|
125
|
+
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
|
|
126
|
+
* **Start simple**: The simplest example adds only 2 lines of code to your app: **1 import, 1 function call**.
|
|
127
|
+
* **Grow large**: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.
|
|
128
|
+
* **Run scripts**: Typer includes a `typer` command/program that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.
|
|
129
|
+
|
|
130
|
+
## FastAPI of CLIs
|
|
131
|
+
|
|
132
|
+
**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.
|
|
133
|
+
|
|
134
|
+
## Installation
|
|
135
|
+
|
|
136
|
+
Create and activate a <a href="https://typer.tiangolo.com/virtual-environments/" class="external-link" target="_blank">virtual environment</a> and then install **Typer**:
|
|
137
|
+
|
|
138
|
+
<div class="termy">
|
|
139
|
+
|
|
140
|
+
```console
|
|
141
|
+
$ pip install typer
|
|
142
|
+
---> 100%
|
|
143
|
+
Successfully installed typer rich shellingham
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
## Example
|
|
149
|
+
|
|
150
|
+
### The absolute minimum
|
|
151
|
+
|
|
152
|
+
* Create a file `main.py` with:
|
|
153
|
+
|
|
154
|
+
```Python
|
|
155
|
+
def main(name: str):
|
|
156
|
+
print(f"Hello {name}")
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
This script doesn't even use Typer internally. But you can use the `typer` command to run it as a CLI application.
|
|
160
|
+
|
|
161
|
+
### Run it
|
|
162
|
+
|
|
163
|
+
Run your application with the `typer` command:
|
|
164
|
+
|
|
165
|
+
<div class="termy">
|
|
166
|
+
|
|
167
|
+
```console
|
|
168
|
+
// Run your application
|
|
169
|
+
$ typer main.py run
|
|
170
|
+
|
|
171
|
+
// You get a nice error, you are missing NAME
|
|
172
|
+
Usage: typer [PATH_OR_MODULE] run [OPTIONS] NAME
|
|
173
|
+
Try 'typer [PATH_OR_MODULE] run --help' for help.
|
|
174
|
+
╭─ Error ───────────────────────────────────────────╮
|
|
175
|
+
│ Missing argument 'NAME'. │
|
|
176
|
+
╰───────────────────────────────────────────────────╯
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
// You get a --help for free
|
|
180
|
+
$ typer main.py run --help
|
|
181
|
+
|
|
182
|
+
Usage: typer [PATH_OR_MODULE] run [OPTIONS] NAME
|
|
183
|
+
|
|
184
|
+
Run the provided Typer app.
|
|
185
|
+
|
|
186
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
187
|
+
│ * name TEXT [default: None] [required] |
|
|
188
|
+
╰───────────────────────────────────────────────────╯
|
|
189
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
190
|
+
│ --help Show this message and exit. │
|
|
191
|
+
╰───────────────────────────────────────────────────╯
|
|
192
|
+
|
|
193
|
+
// Now pass the NAME argument
|
|
194
|
+
$ typer main.py run Camila
|
|
195
|
+
|
|
196
|
+
Hello Camila
|
|
197
|
+
|
|
198
|
+
// It works! 🎉
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
This is the simplest use case, not even using Typer internally, but it can already be quite useful for simple scripts.
|
|
204
|
+
|
|
205
|
+
**Note**: auto-completion works when you create a Python package and run it with `--install-completion` or when you use the `typer` command.
|
|
206
|
+
|
|
207
|
+
## Use Typer in your code
|
|
208
|
+
|
|
209
|
+
Now let's start using Typer in your own code, update `main.py` with:
|
|
210
|
+
|
|
211
|
+
```Python
|
|
212
|
+
import typer
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def main(name: str):
|
|
216
|
+
print(f"Hello {name}")
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
if __name__ == "__main__":
|
|
220
|
+
typer.run(main)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Now you could run it with Python directly:
|
|
224
|
+
|
|
225
|
+
<div class="termy">
|
|
226
|
+
|
|
227
|
+
```console
|
|
228
|
+
// Run your application
|
|
229
|
+
$ python main.py
|
|
230
|
+
|
|
231
|
+
// You get a nice error, you are missing NAME
|
|
232
|
+
Usage: main.py [OPTIONS] NAME
|
|
233
|
+
Try 'main.py --help' for help.
|
|
234
|
+
╭─ Error ───────────────────────────────────────────╮
|
|
235
|
+
│ Missing argument 'NAME'. │
|
|
236
|
+
╰───────────────────────────────────────────────────╯
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
// You get a --help for free
|
|
240
|
+
$ python main.py --help
|
|
241
|
+
|
|
242
|
+
Usage: main.py [OPTIONS] NAME
|
|
243
|
+
|
|
244
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
245
|
+
│ * name TEXT [default: None] [required] |
|
|
246
|
+
╰───────────────────────────────────────────────────╯
|
|
247
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
248
|
+
│ --help Show this message and exit. │
|
|
249
|
+
╰───────────────────────────────────────────────────╯
|
|
250
|
+
|
|
251
|
+
// Now pass the NAME argument
|
|
252
|
+
$ python main.py Camila
|
|
253
|
+
|
|
254
|
+
Hello Camila
|
|
255
|
+
|
|
256
|
+
// It works! 🎉
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
**Note**: you can also call this same script with the `typer` command, but you don't need to.
|
|
262
|
+
|
|
263
|
+
## Example upgrade
|
|
264
|
+
|
|
265
|
+
This was the simplest example possible.
|
|
266
|
+
|
|
267
|
+
Now let's see one a bit more complex.
|
|
268
|
+
|
|
269
|
+
### An example with two subcommands
|
|
270
|
+
|
|
271
|
+
Modify the file `main.py`.
|
|
272
|
+
|
|
273
|
+
Create a `typer.Typer()` app, and create two subcommands with their parameters.
|
|
274
|
+
|
|
275
|
+
```Python hl_lines="3 6 11 20"
|
|
276
|
+
import typer
|
|
277
|
+
|
|
278
|
+
app = typer.Typer()
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
@app.command()
|
|
282
|
+
def hello(name: str):
|
|
283
|
+
print(f"Hello {name}")
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
@app.command()
|
|
287
|
+
def goodbye(name: str, formal: bool = False):
|
|
288
|
+
if formal:
|
|
289
|
+
print(f"Goodbye Ms. {name}. Have a good day.")
|
|
290
|
+
else:
|
|
291
|
+
print(f"Bye {name}!")
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
if __name__ == "__main__":
|
|
295
|
+
app()
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
And that will:
|
|
299
|
+
|
|
300
|
+
* Explicitly create a `typer.Typer` app.
|
|
301
|
+
* The previous `typer.run` actually creates one implicitly for you.
|
|
302
|
+
* Add two subcommands with `@app.command()`.
|
|
303
|
+
* Execute the `app()` itself, as if it was a function (instead of `typer.run`).
|
|
304
|
+
|
|
305
|
+
### Run the upgraded example
|
|
306
|
+
|
|
307
|
+
Check the new help:
|
|
308
|
+
|
|
309
|
+
<div class="termy">
|
|
310
|
+
|
|
311
|
+
```console
|
|
312
|
+
$ python main.py --help
|
|
313
|
+
|
|
314
|
+
Usage: main.py [OPTIONS] COMMAND [ARGS]...
|
|
315
|
+
|
|
316
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
317
|
+
│ --install-completion Install completion │
|
|
318
|
+
│ for the current │
|
|
319
|
+
│ shell. │
|
|
320
|
+
│ --show-completion Show completion for │
|
|
321
|
+
│ the current shell, │
|
|
322
|
+
│ to copy it or │
|
|
323
|
+
│ customize the │
|
|
324
|
+
│ installation. │
|
|
325
|
+
│ --help Show this message │
|
|
326
|
+
│ and exit. │
|
|
327
|
+
╰───────────────────────────────────────────────────╯
|
|
328
|
+
╭─ Commands ────────────────────────────────────────╮
|
|
329
|
+
│ goodbye │
|
|
330
|
+
│ hello │
|
|
331
|
+
╰───────────────────────────────────────────────────╯
|
|
332
|
+
|
|
333
|
+
// When you create a package you get ✨ auto-completion ✨ for free, installed with --install-completion
|
|
334
|
+
|
|
335
|
+
// You have 2 subcommands (the 2 functions): goodbye and hello
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
Now check the help for the `hello` command:
|
|
341
|
+
|
|
342
|
+
<div class="termy">
|
|
343
|
+
|
|
344
|
+
```console
|
|
345
|
+
$ python main.py hello --help
|
|
346
|
+
|
|
347
|
+
Usage: main.py hello [OPTIONS] NAME
|
|
348
|
+
|
|
349
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
350
|
+
│ * name TEXT [default: None] [required] │
|
|
351
|
+
╰───────────────────────────────────────────────────╯
|
|
352
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
353
|
+
│ --help Show this message and exit. │
|
|
354
|
+
╰───────────────────────────────────────────────────╯
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
And now check the help for the `goodbye` command:
|
|
360
|
+
|
|
361
|
+
<div class="termy">
|
|
362
|
+
|
|
363
|
+
```console
|
|
364
|
+
$ python main.py goodbye --help
|
|
365
|
+
|
|
366
|
+
Usage: main.py goodbye [OPTIONS] NAME
|
|
367
|
+
|
|
368
|
+
╭─ Arguments ───────────────────────────────────────╮
|
|
369
|
+
│ * name TEXT [default: None] [required] │
|
|
370
|
+
╰───────────────────────────────────────────────────╯
|
|
371
|
+
╭─ Options ─────────────────────────────────────────╮
|
|
372
|
+
│ --formal --no-formal [default: no-formal] │
|
|
373
|
+
│ --help Show this message │
|
|
374
|
+
│ and exit. │
|
|
375
|
+
╰───────────────────────────────────────────────────╯
|
|
376
|
+
|
|
377
|
+
// Automatic --formal and --no-formal for the bool option 🎉
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
Now you can try out the new command line application:
|
|
383
|
+
|
|
384
|
+
<div class="termy">
|
|
385
|
+
|
|
386
|
+
```console
|
|
387
|
+
// Use it with the hello command
|
|
388
|
+
|
|
389
|
+
$ python main.py hello Camila
|
|
390
|
+
|
|
391
|
+
Hello Camila
|
|
392
|
+
|
|
393
|
+
// And with the goodbye command
|
|
394
|
+
|
|
395
|
+
$ python main.py goodbye Camila
|
|
396
|
+
|
|
397
|
+
Bye Camila!
|
|
398
|
+
|
|
399
|
+
// And with --formal
|
|
400
|
+
|
|
401
|
+
$ python main.py goodbye --formal Camila
|
|
402
|
+
|
|
403
|
+
Goodbye Ms. Camila. Have a good day.
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
</div>
|
|
407
|
+
|
|
408
|
+
### Recap
|
|
409
|
+
|
|
410
|
+
In summary, you declare **once** the types of parameters (*CLI arguments* and *CLI options*) as function parameters.
|
|
411
|
+
|
|
412
|
+
You do that with standard modern Python types.
|
|
413
|
+
|
|
414
|
+
You don't have to learn a new syntax, the methods or classes of a specific library, etc.
|
|
415
|
+
|
|
416
|
+
Just standard **Python**.
|
|
417
|
+
|
|
418
|
+
For example, for an `int`:
|
|
419
|
+
|
|
420
|
+
```Python
|
|
421
|
+
total: int
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
or for a `bool` flag:
|
|
425
|
+
|
|
426
|
+
```Python
|
|
427
|
+
force: bool
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
And similarly for **files**, **paths**, **enums** (choices), etc. And there are tools to create **groups of subcommands**, add metadata, extra **validation**, etc.
|
|
431
|
+
|
|
432
|
+
**You get**: great editor support, including **completion** and **type checks** everywhere.
|
|
433
|
+
|
|
434
|
+
**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.
|
|
435
|
+
|
|
436
|
+
For a more complete example including more features, see the <a href="https://typer.tiangolo.com/tutorial/">Tutorial - User Guide</a>.
|
|
437
|
+
|
|
438
|
+
## Dependencies
|
|
439
|
+
|
|
440
|
+
**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>.
|
|
441
|
+
|
|
442
|
+
By default it also comes with extra standard dependencies:
|
|
443
|
+
|
|
444
|
+
* <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.
|
|
445
|
+
* <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.
|
|
446
|
+
* With `shellingham` you can just use `--install-completion`.
|
|
447
|
+
* Without `shellingham`, you have to pass the name of the shell to install completion for, e.g. `--install-completion bash`.
|
|
448
|
+
|
|
449
|
+
### `typer-slim`
|
|
450
|
+
|
|
451
|
+
If you don't want the extra standard optional dependencies, install `typer-slim` instead.
|
|
452
|
+
|
|
453
|
+
When you install with:
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
pip install typer
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
...it includes the same code and dependencies as:
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
pip install "typer-slim[standard]"
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
The `standard` extra dependencies are `rich` and `shellingham`.
|
|
466
|
+
|
|
467
|
+
**Note**: The `typer` command is only included in the `typer` package.
|
|
468
|
+
|
|
469
|
+
## License
|
|
470
|
+
|
|
471
|
+
This project is licensed under the terms of the MIT license.
|