From 07da00665affbebd903236d7f4656e1745dad6c7 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 22 Apr 2022 20:54:51 +0200 Subject: [PATCH] Add notes about using third-party libraries --- programming/python/creating_nice_python_cli_tools.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/programming/python/creating_nice_python_cli_tools.md b/programming/python/creating_nice_python_cli_tools.md index 6f46638..50939ee 100644 --- a/programming/python/creating_nice_python_cli_tools.md +++ b/programming/python/creating_nice_python_cli_tools.md @@ -4,7 +4,10 @@ * As you are using [poetry](https://python-poetry.org/), following the indications above: * Use [Poetry's support for specifying scripts](https://python-poetry.org/docs/pyproject/#scripts), so when installing your tool via pipx or other means, your scripts are added to the user's path. * Dependencies you define will be installed automatically along with your application. + This reduces the effort users need to use your application if you need third-party libraries. + However, I would still advise to avoid unnecessary dependencies (for simple HTTP requests you can use the base library. If you do complex requests, then using a third-party library might be much simpler). As you are using pipx, those dependencies will be installed to a isolated virtualenv, so they will not interfere with anything on your system. + * As your application is properly packaged, you can split your code into different Python files and use imports without issues. * If your application requires secrets, such as credentials or others, consider using: * The standard [getpass](https://docs.python.org/3/library/getpass.html) module. This prompts for a string on the command line, hiding what the user types. -- 2.47.3