And then I can do things like import a big package (pandas) only after parsing the args, which is highly convenient to users that want to check the argument options without a five second lag.
And then I can do things like import a big package (pandas) only after parsing the args, which is highly convenient to users that want to check the argument options without a five second lag.
What I mean is if you execute script.py help, it will print out the possible options, along with their docstrings, or maybe just the first line.
What is the reason for requiring Python >=3.7?
-- it's probably not the most flexible tool, but IMHO it's the one with the best API: fire.Fire(obj) and everything else is taken care of ;)
p.s.: for lazy imports, just don't put them in the top of your module in the entry point.
Here's a very minimal CLI for one of my PyPI packages: https://github.com/minimaxir/aitextgen/blob/master/aitextgen...
For lazy import - You can do it with click, too, just put your imports in your entrypoint functions.
Click isn't minimalistic though. Nor is poetry or pyenv. Seems to be the main complaints about the article.